@@ -50,7 +50,7 @@ def isfloat(s):
5050 return False
5151
5252
53- def compare_numeric (file1 , file2 ):
53+ def are_files_same (file1 , file2 ):
5454 """Assert that two files have (approximately) the same numerical
5555 values."""
5656 for f1_row , f2_row in zip (file1 , file2 ):
@@ -120,9 +120,9 @@ def test_morph_outputs(self, setup, tmp_path):
120120 for file in common :
121121 with open (tmp_succinct .joinpath (file )) as gf :
122122 with open (test_saving_succinct .joinpath (file )) as tf :
123- generated = filter (ignore_path , gf )
124- target = filter (ignore_path , tf )
125- compare_numeric ( generated , target )
123+ actual = filter (ignore_path , gf )
124+ expected = filter (ignore_path , tf )
125+ are_files_same ( actual , expected )
126126
127127 # Save multiple verbose morphs
128128 tmp_verbose = tmp_path .joinpath ("verbose" )
@@ -161,9 +161,9 @@ def test_morph_outputs(self, setup, tmp_path):
161161 for file in common :
162162 with open (tmp_verbose .joinpath (file )) as gf :
163163 with open (test_saving_verbose .joinpath (file )) as tf :
164- generated = filter (ignore_path , gf )
165- target = filter (ignore_path , tf )
166- compare_numeric ( generated , target )
164+ actual = filter (ignore_path , gf )
165+ expected = filter (ignore_path , tf )
166+ are_files_same ( actual , expected )
167167
168168 def test_morphsqueeze_outputs (self , setup , tmp_path ):
169169 # The file squeeze_morph has a squeeze and stretch applied
@@ -196,9 +196,9 @@ def test_morphsqueeze_outputs(self, setup, tmp_path):
196196 # Check squeeze morph generates the correct output
197197 with open (sqr ) as mf :
198198 with open (target_file ) as tf :
199- morphed = filter (ignore_path , mf )
200- target = filter (ignore_path , tf )
201- compare_numeric ( morphed , target )
199+ actual = filter (ignore_path , mf )
200+ expected = filter (ignore_path , tf )
201+ are_files_same ( actual , expected )
202202
203203 def test_morphfuncy_outputs (self , tmp_path ):
204204 def quadratic (x , y , a0 , a1 , a2 ):
@@ -219,6 +219,6 @@ def quadratic(x, y, a0, a1, a2):
219219
220220 with open (testdata_dir .joinpath ("funcy_target.cgr" )) as tf :
221221 with open (tmp_path .joinpath ("funcy_target.cgr" )) as gf :
222- generated = filter (ignore_path , gf )
223- target = filter (ignore_path , tf )
224- compare_numeric ( generated , target )
222+ actual = filter (ignore_path , gf )
223+ expected = filter (ignore_path , tf )
224+ are_files_same ( actual , expected )
0 commit comments