Skip to content

Commit

Permalink
Add test for environment obs_type="ram"
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudo-rnd-thoughts committed Jun 26, 2024
1 parent 26db505 commit cf2374a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/python/test_atari_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,22 @@ def test_gym_ram_obs(tetris_env):
assert obs.shape == (128,)


def test_ram_obs():
env = gymnasium.make("ALE/Breakout-v5", obs_type="ram")

obs, _ = env.reset()
print(obs)
print(np.unique(obs))
assert len(np.unique(obs)) > 1, np.unique(obs)

obs, *_ = env.step(env.action_space.sample())
print(obs)
print(np.unique(obs))
assert len(np.unique(obs)) > 1, np.unique(obs)

env.close()


@pytest.mark.parametrize("tetris_env", [{"obs_type": "grayscale"}], indirect=True)
def test_gym_img_grayscale_obs(tetris_env):
tetris_env.reset()
Expand Down

0 comments on commit cf2374a

Please sign in to comment.