Skip to content

Commit b0eb05d

Browse files
drvinceknightmarcharper
authored andcommitted
Use pd.Dataframe.equals
Attempting to make file comparison work on windows.
1 parent f8b53aa commit b0eb05d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

axelrod/tests/unit/test_tournament.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from hypothesis.strategies import integers, floats
1616
from tqdm import tqdm
1717
import numpy as np
18+
import pandas as pd
1819

1920
from axelrod.tests.property import (tournaments,
2021
prob_end_tournaments,
@@ -685,9 +686,9 @@ def test_write_to_csv_with_results(self):
685686
turns=2,
686687
repetitions=2)
687688
tournament.play(filename=self.filename, progress_bar=False)
688-
self.assertTrue(filecmp.cmp(self.filename,
689-
"test_outputs/expected_test_tournament.csv",
690-
shallow=False))
689+
df = pd.read_csv(self.filename)
690+
expected_df = pd.read_csv("test_outputs/expected_test_tournament.csv")
691+
self.assertTrue(df.equals(expected_df))
691692

692693
def test_write_to_csv_without_results(self):
693694
tournament = axelrod.Tournament(
@@ -698,9 +699,9 @@ def test_write_to_csv_without_results(self):
698699
repetitions=2)
699700
tournament.play(filename=self.filename, progress_bar=False,
700701
build_results=False)
701-
self.assertTrue(filecmp.cmp(self.filename,
702-
"test_outputs/expected_test_tournament_no_results.csv",
703-
shallow=False))
702+
df = pd.read_csv(self.filename)
703+
expected_df = pd.read_csv("test_outputs/expected_test_tournament_no_results.csv")
704+
self.assertTrue(df.equals(expected_df))
704705

705706

706707
class TestProbEndTournament(unittest.TestCase):

0 commit comments

Comments
 (0)