def test_check_for_players_not_in_matching(player_names, seed): """Test that StableMarriage recognises a valid matching requires all players to be matched in the matching.""" suitors, reviewers = make_players(player_names, seed) game = StableMarriage(suitors, reviewers) matching = game.solve() player = game.suitors[0] matching[player] = None with pytest.raises(MatchingError) as e: game.check_validity() error = e.players[0] assert error.startswith(player.name)
def test_check_validity(player_names, seed): """ Test that StableMarriage finds no errors when the game is solved. """ suitors, reviewers = make_players(player_names, seed) game = StableMarriage(suitors, reviewers) game.solve() assert game.check_validity()