77import importlib .util
88import urllib .error
99
10- from gym .core import ObsType
11-
1210_has_isaac = importlib .util .find_spec ("isaacgym" ) is not None
1311
1412if _has_isaac :
2523from contextlib import nullcontext
2624from pathlib import Path
2725from sys import platform
28- from typing import Optional , Tuple , Union
26+ from typing import Optional , Union
2927from unittest import mock
3028
3129import numpy as np
@@ -638,7 +636,8 @@ def test_torchrl_to_gym(self, backend, numpy):
638636
639637 @implement_for ("gym" , None , "0.26" )
640638 def test_gym_dict_action_space (self ):
641- pytest .skip ("tested for gym > 0.26 - no backward issue" )
639+ torchrl_logger .info ("tested for gym > 0.26 - no backward issue" )
640+ return
642641
643642 @implement_for ("gym" , "0.26" , None )
644643 def test_gym_dict_action_space (self ): # noqa: F811
@@ -653,14 +652,17 @@ def __init__(self):
653652 self .observation_space = gym .spaces .Box (- 1 , 1 )
654653
655654 def step (self , action ):
655+ assert isinstance (action , dict )
656+ assert isinstance (action ["a0" ], np .ndarray )
657+ assert isinstance (action ["a1" ], np .ndarray )
656658 return (0.5 , 0.0 , False , False , {})
657659
658660 def reset (
659661 self ,
660662 * ,
661663 seed : Optional [int ] = None ,
662664 options : Optional [dict ] = None ,
663- ) -> Tuple [ ObsType , dict ] :
665+ ):
664666 return (0.0 , {})
665667
666668 env = CompositeActionEnv ()
@@ -686,14 +688,17 @@ def __init__(self):
686688 self .observation_space = gym .spaces .Box (- 1 , 1 )
687689
688690 def step (self , action ):
691+ assert isinstance (action , dict )
692+ assert isinstance (action ["a0" ], np .ndarray )
693+ assert isinstance (action ["a1" ], np .ndarray )
689694 return (0.5 , 0.0 , False , False , {})
690695
691696 def reset (
692697 self ,
693698 * ,
694699 seed : Optional [int ] = None ,
695700 options : Optional [dict ] = None ,
696- ) -> Tuple [ ObsType , dict ] :
701+ ):
697702 return (0.0 , {})
698703
699704 env = CompositeActionEnv ()
0 commit comments