From 707742e45d3ca658696dd1da6c57cb9cbbfb6a48 Mon Sep 17 00:00:00 2001 From: Elliot Tower Date: Tue, 14 Nov 2023 19:09:20 -0500 Subject: [PATCH] Except errors from invalid actions for pettingzoo tests --- tests/unit/test_arena.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_arena.py b/tests/unit/test_arena.py index b8afc31c..1c882204 100644 --- a/tests/unit/test_arena.py +++ b/tests/unit/test_arena.py @@ -2,6 +2,9 @@ import unittest from unittest import TestCase +import pytest + +import chatarena from chatarena import EXAMPLES_DIR from chatarena.arena import Arena @@ -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() @@ -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()