Files
Gymnasium/gym/tests/test_core.py

18 lines
355 B
Python
Raw Normal View History

from gym import core
2021-07-29 02:26:34 +02:00
class ArgumentEnv(core.Env):
calls = 0
def __init__(self, arg):
self.calls += 1
self.arg = arg
2021-07-29 02:26:34 +02:00
def test_env_instantiation():
# This looks like a pretty trivial, but given our usage of
# __new__, it's worth having.
2021-07-29 02:26:34 +02:00
env = ArgumentEnv("arg")
assert env.arg == "arg"
assert env.calls == 1