Skip to content

Commit

Permalink
Except errors from invalid actions for pettingzoo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottower committed Nov 15, 2023
1 parent bec6a85 commit 707742e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/unit/test_arena.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import unittest
from unittest import TestCase

import pytest

import chatarena
from chatarena import EXAMPLES_DIR
from chatarena.arena import Arena

Expand Down Expand Up @@ -101,9 +104,10 @@ def test_arena_6(self):
not os.getenv("OPENAI_API_KEY"),
"OpenAI API key must be set to run this test.",
)
@pytest.mark.xfail(raises=chatarena.arena.TooManyInvalidActions)
def test_arena_7(self):
arena = Arena.from_config(os.path.join(EXAMPLES_DIR, "pettingzoo_chess.json"))
for i in range(1, 2):
for i in range(1, 10):
print(f"=== Step {i} ===")
arena.step()
arena.environment.print()
Expand Down Expand Up @@ -159,11 +163,12 @@ def test_arena_10(self):
not os.getenv("OPENAI_API_KEY"),
"OpenAI API key must be set to run this test.",
)
@pytest.mark.xfail(raises=chatarena.arena.TooManyInvalidActions)
def test_arena_11(self):
arena = Arena.from_config(
os.path.join(EXAMPLES_DIR, "pettingzoo_tictactoe.json")
)
for i in range(1, 2):
for i in range(1, 10):
print(f"=== Step {i} ===")
arena.step()
arena.environment.print()
Expand Down

0 comments on commit 707742e

Please sign in to comment.