Skip to content

Commit 5a36d22

Browse files
committed
no payoff tests for BinaryTreeGames in test_reduced_strategic_form
1 parent f3606ac commit 5a36d22

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

tests/games.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,7 @@ def gbt_game(self):
449449
return g
450450

451451
def reduced_strategic_form(self):
452-
# special case for 1 player
453-
dims = (
454-
(self.size_of_rsf[0], 1) if len(self.size_of_rsf) == 1 else self.size_of_rsf
455-
)
456-
457-
zeros = np.zeros(dims, dtype=int)
458-
return [zeros] * len(self.players)
452+
return None
459453

460454

461455
class BinEfgOnePlayerIR(BinaryTreeGames):

tests/test_extensive.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def test_outcome_index_exception_label():
487487
],
488488
)
489489
def test_reduced_strategic_form(
490-
game: gbt.Game, strategy_labels: list, np_arrays_of_rsf: list
490+
game: gbt.Game, strategy_labels: list, np_arrays_of_rsf: typing.Union[list, None]
491491
):
492492
"""
493493
We test two things:
@@ -499,6 +499,7 @@ def test_reduced_strategic_form(
499499

500500
for i, player in enumerate(game.players):
501501
assert strategy_labels[i] == [s.label for s in player.strategies]
502-
# convert strings to rationals
503-
exp_array = games.vectorized_make_rational(np_arrays_of_rsf[i])
504-
assert (arrays[i] == exp_array).all()
502+
if np_arrays_of_rsf is not None:
503+
# convert strings to rationals
504+
exp_array = games.vectorized_make_rational(np_arrays_of_rsf[i])
505+
assert (arrays[i] == exp_array).all()

0 commit comments

Comments
 (0)