Skip to content

Commit 3946c5f

Browse files
committed
fix test_enumpoly_behavior_{7,8} given change in issue_756
1 parent 0f02db1 commit 3946c5f

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

tests/test_nash.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,35 +2062,29 @@ def test_nash_strategy_solver_w_start(test_case: EquilibriumTestCaseWithStart, s
20622062
pytest.param(
20632063
EquilibriumTestCase(
20642064
factory=functools.partial(games.read_from_file, "3_player.efg"),
2065-
solver=functools.partial(gbt.nash.enumpoly_solve, stop_after=2),
2065+
solver=functools.partial(gbt.nash.enumpoly_solve, stop_after=None),
20662066
expected=[
2067-
[[d(1, 0), d(1, 0)], [d(1, 0), d("1/2", "1/2")], [d(1, 0), d(0, 1)]],
2068-
[[d(1, 0), d(1, 0)], [d(1, 0), d(0, 1)], [d(1, 0), d("1/3", "2/3")]],
2067+
[[d(1, 0), d(1, 0)], [d(1, 0), d("1/2", "1/2")], [d(1, 0), d(1, 0)]],
2068+
[[d(1, 0), d(1, 0)], [d(1, 0), d("1/2", "1/2")], [d(1, 0), d(0, 1)]],
20692069
],
20702070
regret_tol=TOL,
20712071
prob_tol=TOL,
20722072
),
2073-
marks=[
2074-
pytest.mark.nash_enumpoly_behavior,
2075-
pytest.mark.xfail(reason="Changes in operation of enumpoly"),
2076-
],
2073+
marks=pytest.mark.nash_enumpoly_behavior,
20772074
id="test_enumpoly_behavior_7",
20782075
),
20792076
pytest.param(
20802077
EquilibriumTestCase(
20812078
factory=functools.partial(games.read_from_file, "3_player_with_nonterm_outcomes.efg"),
20822079
solver=functools.partial(gbt.nash.enumpoly_solve, stop_after=2),
20832080
expected=[
2084-
[[d(1, 0), d(1, 0)], [d(1, 0), d("1/2", "1/2")], [d(1, 0), d(0, 1)]],
2085-
[[d(1, 0), d(1, 0)], [d(1, 0), d(0, 1)], [d(1, 0), d("1/3", "2/3")]],
2081+
[[d(1, 0), d(1, 0)], [d(1, 0), d("1/2", "1/2")], [d(1, 0), d(1, 0)]],
2082+
[[d(1, 0), d(1, 0)], [d(1, 0), d("1/2", "1/2")], [d(1, 0), d(0, 1)]],
20862083
],
20872084
regret_tol=TOL,
20882085
prob_tol=TOL,
20892086
),
2090-
marks=[
2091-
pytest.mark.nash_enumpoly_behavior,
2092-
pytest.mark.xfail(reason="Changes in operation of enumpoly"),
2093-
],
2087+
marks=pytest.mark.nash_enumpoly_behavior,
20942088
id="test_enumpoly_behavior_8",
20952089
),
20962090
# 4-player game
@@ -2163,6 +2157,14 @@ def test_nash_behavior_solver(test_case: EquilibriumTestCase, subtests) -> None:
21632157
with subtests.test("number of equilibria found"):
21642158
assert len(result.equilibria) == len(test_case.expected)
21652159
for i, (eq, exp) in enumerate(zip(result.equilibria, test_case.expected, strict=True)):
2160+
2161+
# print("EQ:")
2162+
# print(eq)
2163+
# print("EXP:")
2164+
# print(exp)
2165+
# print("===================")
2166+
2167+
21662168
with subtests.test(eq=i, check="max_regret"):
21672169
assert eq.max_regret() <= test_case.regret_tol
21682170
with subtests.test(eq=i, check="max_regret"):

0 commit comments

Comments
 (0)