mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-01 06:07:08 +00:00
* feat: add `isort` to `pre-commit` * ci: skip `__init__.py` file for `isort` * ci: make `isort` mandatory in lint pipeline * docs: add a section on Git hooks * ci: check isort diff * fix: isort from master branch * docs: add pre-commit badge * ci: update black + bandit versions * feat: add PR template * refactor: PR template * ci: remove bandit * docs: add Black badge * ci: try to remove all `|| true` statements * ci: remove lint_python job - Remove `lint_python` CI job - Move `pyupgrade` job to `pre-commit` workflow * fix: avoid messing with typing * docs: add a note on running `pre-cpmmit` manually * ci: apply `pre-commit` to the whole codebase
25 lines
661 B
Python
25 lines
661 B
Python
import pytest
|
|
|
|
try:
|
|
import Box2D
|
|
|
|
from gym.envs.box2d.lunar_lander import LunarLander, demo_heuristic_lander
|
|
except ImportError:
|
|
Box2D = None
|
|
|
|
|
|
@pytest.mark.skipif(Box2D is None, reason="Box2D not installed")
|
|
def test_lunar_lander():
|
|
_test_lander(LunarLander(), seed=0)
|
|
|
|
|
|
@pytest.mark.skipif(Box2D is None, reason="Box2D not installed")
|
|
def test_lunar_lander_continuous():
|
|
_test_lander(LunarLander(continuous=True), seed=0)
|
|
|
|
|
|
@pytest.mark.skipif(Box2D is None, reason="Box2D not installed")
|
|
def _test_lander(env, seed=None, render=False):
|
|
total_reward = demo_heuristic_lander(env, seed=seed, render=render)
|
|
assert total_reward > 100
|