mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-19 21:42:02 +00:00
* 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
19 lines
420 B
Python
19 lines
420 B
Python
from gym import error
|
|
from gym.utils import seeding
|
|
|
|
|
|
def test_invalid_seeds():
|
|
for seed in [-1, "test"]:
|
|
try:
|
|
seeding.np_random(seed)
|
|
except error.Error:
|
|
pass
|
|
else:
|
|
assert False, "Invalid seed {} passed validation".format(seed)
|
|
|
|
|
|
def test_valid_seeds():
|
|
for seed in [0, 1]:
|
|
random, seed1 = seeding.np_random(seed)
|
|
assert seed == seed1
|