mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-31 10:09:53 +00:00
Test refactoring (#2427)
* Move tests to root with automatic PyCharm import refactoring. This will likely fail some tests * Changed entry point for a registration test env. * Move a stray lunar_lander test to tests/envs/... * black * Change the version from which importlib_metadata is replaced with importlib.metadata. Also requiring installing importlib_metadata for python 3.8 now. ??????????? * Undo last commit
This commit is contained in:
committed by
GitHub
parent
ca42b05243
commit
947b857bd4
20
tests/vector/test_vector_env_wrapper.py
Normal file
20
tests/vector/test_vector_env_wrapper.py
Normal file
@@ -0,0 +1,20 @@
|
||||
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-v1", asynchronous=False)
|
||||
wrapped = DummyWrapper(env)
|
||||
wrapped.reset()
|
||||
assert wrapped.counter == 1
|
Reference in New Issue
Block a user