Skip to content

Commit

Permalink
Access the 'one' and 'two' fields directly to avoid PyLint false-posi…
Browse files Browse the repository at this point in the history
…tives caused by Optional fields in PlayerPair initialized to None. See pylint-dev/pylint#3882.
  • Loading branch information
cpatrasciuc committed Jun 17, 2022
1 parent aeba7ac commit 77989fb
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/ai/utils_test.py
Expand Up @@ -363,7 +363,7 @@ def test_game_state(self):
def test_cards_missing_in_both_hands(self):
game_state = get_game_state_for_tests()
game_view = game_state.next_player_view()
game_view.cards_in_hand[PlayerId.ONE][0] = None
game_view.cards_in_hand.one[0] = None
unseen_cards = get_unseen_cards(game_view)
with self.assertRaisesRegex(AssertionError, "Cards missing in both hands"):
populate_game_view(game_view, unseen_cards)
Expand Down
2 changes: 1 addition & 1 deletion src/model/game_state_test.py
Expand Up @@ -391,7 +391,7 @@ def test_next_player_two_view(self):

def test_next_player_two_view_with_played_card(self):
game_state = get_game_state_for_tests()
played_card = game_state.cards_in_hand[PlayerId.ONE][3]
played_card = game_state.cards_in_hand.one[3]
with GameStateValidator(game_state):
game_state.current_trick[PlayerId.ONE] = played_card
game_state.next_player = PlayerId.TWO
Expand Down

0 comments on commit 77989fb

Please sign in to comment.