Skip to content

Commit 2c19310

Browse files
authored
Merge pull request #1 from pllim/pr10
rtol backward-compatibility
2 parents 5e7c375 + 5572b93 commit 2c19310

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pytest_arraydiff/plugin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,13 @@ def write(filename, data, **kwargs):
121121

122122
@classmethod
123123
def compare(cls, reference_file, test_file, atol=None, rtol=None):
124+
import astropy
124125
from astropy.io.fits.diff import FITSDiff
125-
diff = FITSDiff(reference_file, test_file, rtol=rtol)
126+
from astropy.utils.introspection import minversion
127+
if minversion(astropy, '2.0'):
128+
diff = FITSDiff(reference_file, test_file, rtol=rtol)
129+
else:
130+
diff = FITSDiff(reference_file, test_file, tolerance=rtol)
126131
return diff.identical, diff.report()
127132

128133

0 commit comments

Comments
 (0)