@@ -40,7 +40,7 @@ def test_succeeds_func_fits_hdu():
40
40
return fits .PrimaryHDU (np .arange (3 * 5 ).reshape ((3 , 5 )).astype (np .int64 ))
41
41
42
42
43
- class TestClass ( object ) :
43
+ class TestClass :
44
44
45
45
@pytest .mark .array_compare (file_format = 'fits' , reference_dir = reference_dir )
46
46
def test_succeeds_class (self ):
@@ -66,11 +66,11 @@ def test_fails():
66
66
f .write (TEST_FAILING )
67
67
68
68
# If we use --arraydiff, it should detect that the file is missing
69
- code = subprocess .call ('pytest --arraydiff {0}' . format ( test_file ) , shell = True )
69
+ code = subprocess .call (f 'pytest --arraydiff { test_file } ' , shell = True )
70
70
assert code != 0
71
71
72
72
# If we don't use --arraydiff option, the test should succeed
73
- code = subprocess .call ('pytest {0}' . format ( test_file ) , shell = True )
73
+ code = subprocess .call (f 'pytest { test_file } ' , shell = True )
74
74
assert code == 0
75
75
76
76
@@ -102,7 +102,7 @@ def test_generate(file_format):
102
102
assert b'File not found for comparison test' in grepexc .output
103
103
104
104
# If we do generate, the test should succeed and a new file will appear
105
- code = subprocess .call (['pytest' , '--arraydiff-generate-path={0}' . format ( gen_dir ) , test_file ],
105
+ code = subprocess .call (['pytest' , f '--arraydiff-generate-path={ gen_dir } ' , test_file ],
106
106
timeout = 10 )
107
107
assert code == 0
108
108
assert os .path .exists (os .path .join (gen_dir , 'test_gen.' + ('fits' if file_format == 'fits' else 'txt' )))
@@ -130,8 +130,8 @@ def test_default_format(file_format):
130
130
gen_dir = os .path .join (tmpdir , 'spam' , 'egg' )
131
131
132
132
# If we do generate, the test should succeed and a new file will appear
133
- code = subprocess .call ('pytest -s --arraydiff-default-format={0 }'
134
- ' --arraydiff-generate-path={1 } {2 }' .format (file_format , gen_dir , test_file ), shell = True )
133
+ code = subprocess .call ('pytest -s --arraydiff-default-format={}'
134
+ ' --arraydiff-generate-path={} {}' .format (file_format , gen_dir , test_file ), shell = True )
135
135
assert code == 0
136
136
assert os .path .exists (os .path .join (gen_dir , 'test_default.' + ('fits' if file_format == 'fits' else 'txt' )))
137
137
0 commit comments