Skip to content

Commit

Permalink
Tolerance for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alocate committed Feb 10, 2021
1 parent 9f58978 commit fe00e12
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ def run_test(mmr0, rd0, winning_team, number_of_teams, mmr1, rd1):
ratings_list = result["ratings_list"]
rds_list = result["rds_list"]

rl = [np.round(num) for num in ratings_list]
rd = [np.round(num) for num in rds_list]
number_of_players = len(ratings_list)

assert rl == mmr1
assert rd == rd1
diff_mmr = [np.abs(ratings_list[i] - mmr1[i]) for i in range(number_of_players)]
diff_rd = [np.abs(rds_list[i] - rd1[i]) for i in range(number_of_players)]
assert np.max(diff_mmr) < 1
assert np.max(diff_rd) < 1


def test_2x2():
Expand Down

0 comments on commit fe00e12

Please sign in to comment.