Skip to content

Fix floating point error in a hyp test #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion axelrod/tests/unit/test_resultset.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,15 @@ def test_equality_with_round_robin(self, tournament):
progress_bar=False)

# Not testing full equality because of floating point errors.
self.assertEqual(rs.ranked_names, brs.ranked_names)
self.assertEqual(rs.scores, brs.scores)
self.assertEqual(rs.wins, brs.wins)
self.assertEqual(rs.match_lengths, brs.match_lengths)
self.assertEqual(rs.cooperation, brs.cooperation)

# Test that players are in the results (due to floating point errors
# the order might not be the same)
self.assertEqual(set(rs.ranked_names), set(brs.ranked_names))

@given(tournament=prob_end_tournaments(max_size=5,
min_prob_end=.7,
max_repetitions=3))
Expand Down