Files
Gymnasium/gym/envs/tests/spec_list.py
pzhokhov 5c116fb3c9 box2d kengz vs py (#1097)
* try build with box2d-kengz

* test box2d envs

* use box2d-py in tox.ini for tests

* box2d-py instead of box2d-kengz in box2d dependencies

* test dependencies in tox.ini use dependencies in setup.py

* further cleanups of tox.ini

* further cleanups

* added scipy to list of requirements
2018-07-13 14:05:56 -07:00

21 lines
891 B
Python

from gym import envs, logger
import os
def should_skip_env_spec_for_tests(spec):
# We skip tests for envs that require dependencies or are otherwise
# troublesome to run frequently
ep = spec._entry_point
# Skip mujoco tests for pull request CI
skip_mujoco = not (os.environ.get('MUJOCO_KEY_BUNDLE') or os.path.exists(os.path.expanduser('~/.mujoco')))
if skip_mujoco and ep.startswith('gym.envs.mujoco:'):
return True
if ( 'GoEnv' in ep or
'HexEnv' in ep or
(ep.startswith("gym.envs.atari") and not spec.id.startswith("Pong") and not spec.id.startswith("Seaquest"))
):
logger.warn("Skipping tests for env {}".format(ep))
return True
return False
spec_list = [spec for spec in sorted(envs.registry.all(), key=lambda x: x.id) if spec._entry_point is not None and not should_skip_env_spec_for_tests(spec)]