mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-22 07:02:19 +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
21 lines
492 B
Python
21 lines
492 B
Python
import numpy as np
|
|
import pytest
|
|
|
|
import gym
|
|
from gym.wrappers import OrderEnforcing
|
|
|
|
|
|
def test_order_enforcing_reset_info():
|
|
env = gym.make("CartPole-v1")
|
|
env = OrderEnforcing(env)
|
|
ob_space = env.observation_space
|
|
obs = env.reset()
|
|
assert ob_space.contains(obs)
|
|
del obs
|
|
obs = env.reset(return_info=False)
|
|
assert ob_space.contains(obs)
|
|
del obs
|
|
obs, info = env.reset(return_info=True)
|
|
assert ob_space.contains(obs)
|
|
assert isinstance(info, dict)
|