Skip to content

Commit

Permalink
test render
Browse files Browse the repository at this point in the history
  • Loading branch information
AOS55 committed May 21, 2024
1 parent 395d4b1 commit 2cacd2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/graphics/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
@pytest.mark.parametrize("env_spec", envs)
def test_render(env_spec):
env = gym.make(env_spec, render_mode="rgb_array")
env.configure({"offscreen_rendering": True})
env.unwrapped.configure({"offscreen_rendering": True})
env.reset()
img = env.render()
print(f'type(image): {type(img)}')
env.close()
assert isinstance(img, np.ndarray)
assert img.shape == (
env.config["screen_height"],
env.config["screen_width"],
env.unwrapped.config["screen_size"],
env.unwrapped.config["screen_size"],
3
) # (H,W,C)

0 comments on commit 2cacd2f

Please sign in to comment.