Open
Description
Hi everyone,
currently the parameterization of tests could be improved. For example the fixture all_tasks
returns a list. However, pytest allows to paramterize fixtures, such that we can pass single envs and omit the for loops in the tests:
def test_env_reset(all_env: list[gym.Env]):
"""Test the reset functionality of our environments.
This test function verifies that the reset method of the environments produces
consistent initial states when called with the same seed.
Args:
all_env (list[gym.Env]): List of environment instances to test.
The test:
1. Calls reset twice with same seed (0)
2. Verifies state is not None
3. Asserts both calls return same initial state vectors
"""
for env in all_env:
x, _ = env.reset(seed=0)
assert x is not None
x_, _ = env.reset(seed=0)
assert np.allclose(x, x_)
Furthermore, currently the tests are not really structured accordingly to the project structure... Thus, my suggestion would be a restructuring of the tests!
Metadata
Metadata
Assignees
Labels
No labels