mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-07-31 22:04:31 +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
20 lines
449 B
Python
20 lines
449 B
Python
import gym
|
|
from gym.vector import VectorEnvWrapper, make
|
|
|
|
|
|
class DummyWrapper(VectorEnvWrapper):
|
|
def __init__(self, env):
|
|
self.env = env
|
|
self.counter = 0
|
|
|
|
def reset_async(self, **kwargs):
|
|
super().reset_async()
|
|
self.counter += 1
|
|
|
|
|
|
def test_vector_env_wrapper_inheritance():
|
|
env = make("FrozenLake-v1", asynchronous=False)
|
|
wrapped = DummyWrapper(env)
|
|
wrapped.reset()
|
|
assert wrapped.counter == 1
|