Files
Gymnasium/gym/vector/tests/test_vector_env_wrapper.py
pzhokhov 32eee9cd10 fix method forwarding in VectorEnvWrapper (#1917)
* fix method forwarding in VectorEnvWrapper

* add unit test for vectorenvWrapper methods
2020-08-14 14:20:56 -07:00

21 lines
465 B
Python

import gym
from gym.vector import make
from gym.vector import VectorEnvWrapper
class DummyWrapper(VectorEnvWrapper):
def __init__(self, env):
self.env = env
self.counter = 0
def reset_async(self):
super().reset_async()
self.counter += 1
def test_vector_env_wrapper_inheritance():
env = make('FrozenLake-v0', asynchronous=False)
wrapped = DummyWrapper(env)
wrapped.reset()
assert wrapped.counter == 1