Files
Gymnasium/tests/vector/test_vector_env_wrapper.py

21 lines
461 B
Python
Raw Normal View History

import gym
from gym.vector import make
from gym.vector import VectorEnvWrapper
2021-07-29 02:26:34 +02:00
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-v1", asynchronous=False)
wrapped = DummyWrapper(env)
wrapped.reset()
assert wrapped.counter == 1