Skip to content

Commit 1124bb1

Browse files
committed
Fixed tests to skip parallel tests (not applicable to turn based game)
1 parent 0a25a01 commit 1124bb1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/test_gobblet_env.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,21 @@ def test_reset(env):
2222

2323
def test_reset_starting(env):
2424
"Verify that reset() sets the board state to the correct starting position"
25-
26-
assert (env.board.squares == np.zeros(27)).all()
25+
raw_env = gobblet_v1.raw_env(render_mode=None)
26+
raw_env.reset()
27+
assert (raw_env.board.squares == np.zeros(27)).all()
28+
raw_env.close()
2729

2830

31+
# PettingZoo Tests
2932
def test_api(env):
3033
"Test the env using PettingZoo's API test function"
3134
pettingzoo.test.api_test(env, num_cycles=10, verbose_progress=False)
3235

3336

37+
@pytest.mark.skip(
38+
reason="gobblet is an AEC environment and turns need to be taken in order (or else illegal moves can occur)"
39+
)
3440
def test_parallel_api(env):
3541
env = gobblet_v1.parallel_env(render_mode=None)
3642
pettingzoo.test.parallel_api_test(env, num_cycles=1000)
@@ -45,9 +51,10 @@ def test_seed_raw(env):
4551

4652

4753
@pytest.mark.skip(
48-
reason="parallel envs are not currently used, therefore there is no max_cycles argument "
54+
reason="gobblet is an AEC environment so it does not have the attribute max_cylces"
4955
)
5056
def test_max_cycles(env):
57+
env = gobblet_v1
5158
pettingzoo.test.max_cycles_test(env)
5259

5360

0 commit comments

Comments
 (0)