Files
Gymnasium/tests/vector/test_vector_env_wrapper.py
Mark Towers bf093c6890 Update the flake8 pre-commit ignores (#2778)
* Remove additional ignores from flake8

* Remove all unused imports

* Remove all unused imports

* Update flake8 and pyupgrade

* F841, removed unused variables

* E731, removed lambda assignment to variables

* Remove E731, F403, F405, F524

* Remove E722, bare exceptions

* Remove E712, compare variable == True or == False to is True or is False

* Remove E402, module level import not at top of file

* Added --pre-file-ignores

* Add --per-file-ignores removing E741, E302 and E704

* Add E741, do not use variables named ‘l’, ‘O’, or ‘I’ to ignore issues in classic control

* Fixed issues for pytest==6.2

* Remove unnecessary # noqa

* Edit comment with the removal of E302

* Added warnings and declared module, attr for pyright type hinting

* Remove unused import

* Removed flake8 E302

* Updated flake8 from 3.9.2 to 4.0.1

* Remove unused variable
2022-04-26 11:18:37 -04:00

19 lines
438 B
Python

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