22from unittest .mock import patch
33
44import os
5-
65from tempfile import mkstemp
7-
86import matplotlib .pyplot
9-
107import numpy as np
8+ import pathlib
119
1210import axelrod as axl
1311from axelrod .fingerprint import AshlockFingerprint , Point , TransitiveFingerprint
12+ from axelrod .load_data_ import axl_filename
1413from axelrod .strategy_transformers import DualTransformer , JossAnnTransformer
1514from axelrod .tests .property import strategy_lists
1615
@@ -200,7 +199,8 @@ def test_temp_file_creation(self):
200199
201200 RecordedMksTemp .reset_record ()
202201 af = AshlockFingerprint (axl .TitForTat )
203- filename = "test_outputs/test_fingerprint.csv"
202+ path = pathlib .Path ("test_outputs/test_fingerprint.csv" )
203+ filename = axl_filename (path )
204204
205205 self .assertEqual (RecordedMksTemp .record , [])
206206
@@ -216,7 +216,8 @@ def test_temp_file_creation(self):
216216 self .assertFalse (os .path .isfile (filename ))
217217
218218 def test_fingerprint_with_filename (self ):
219- filename = "test_outputs/test_fingerprint.csv"
219+ path = pathlib .Path ("test_outputs/test_fingerprint.csv" )
220+ filename = axl_filename (path )
220221 af = AshlockFingerprint (axl .TitForTat )
221222 af .fingerprint (
222223 turns = 1 , repetitions = 1 , step = 0.5 , progress_bar = False , filename = filename
@@ -430,7 +431,8 @@ def test_init_with_not_default_number(self):
430431 )
431432
432433 def test_fingerprint_with_filename (self ):
433- filename = "test_outputs/test_fingerprint.csv"
434+ path = pathlib .Path ("test_outputs/test_fingerprint.csv" )
435+ filename = axl_filename (path )
434436 strategy = axl .TitForTat ()
435437 tf = TransitiveFingerprint (strategy )
436438 tf .fingerprint (turns = 1 , repetitions = 1 , progress_bar = False , filename = filename )
@@ -441,8 +443,11 @@ def test_fingerprint_with_filename(self):
441443 def test_serial_fingerprint (self ):
442444 strategy = axl .TitForTat ()
443445 tf = TransitiveFingerprint (strategy )
446+ path = pathlib .Path ("test_outputs/test_fingerprint.csv" )
444447 tf .fingerprint (
445- repetitions = 1 , progress_bar = False , filename = "test_outputs/tran_fin.csv"
448+ repetitions = 1 ,
449+ progress_bar = False ,
450+ filename = axl_filename (path ),
446451 )
447452 self .assertEqual (tf .data .shape , (50 , 50 ))
448453
@@ -455,7 +460,8 @@ def test_parallel_fingerprint(self):
455460
456461 def test_analyse_cooperation_ratio (self ):
457462 tf = TransitiveFingerprint (axl .TitForTat )
458- filename = "test_outputs/test_fingerprint.csv"
463+ path = pathlib .Path ("test_outputs/test_fingerprint.csv" )
464+ filename = axl_filename (path )
459465 with open (filename , "w" ) as f :
460466 f .write (
461467 """Interaction index,Player index,Opponent index,Repetition,Player name,Opponent name,Actions
0 commit comments