Skip to content

Commit 18d085b

Browse files
committed
Try combined reset/step test
1 parent 3922440 commit 18d085b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

minetester/tests/test_env.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,16 @@ def minetest_env(unique_env_port, unique_server_port, request):
4444
mt.close()
4545

4646

47-
def test_reset(minetest_env):
48-
"""Tests reset return types."""
47+
def test_reset_step_returns(minetest_env):
48+
"""Test reset and step return types."""
4949
obs, info = minetest_env.reset()
5050
assert isinstance(obs, np.ndarray)
5151
assert isinstance(info, dict)
52-
53-
54-
def test_step(minetest_env):
55-
"""Tests step return types."""
56-
obs, info = minetest_env.reset()
5752
action = minetest_env.action_space.sample()
53+
assert isinstance(action, dict) and all(
54+
isinstance(key, str) and isinstance(value, (int, np.int64, np.ndarray))
55+
for key, value in action.items()
56+
)
5857
obs, rew, done, truncated, info = minetest_env.step(action)
5958
assert isinstance(obs, np.ndarray)
6059
assert isinstance(rew, float)

0 commit comments

Comments
 (0)