python-sherpa/sherpa-pr1227-astropy43.patch

33 lines
1.2 KiB
Diff

From 630574022f538c86265ba01c283b8ebc39ce41a0 Mon Sep 17 00:00:00 2001
From: Douglas Burke <dburke.gw@gmail.com>
Date: Mon, 26 Jul 2021 16:10:25 -0400
Subject: [PATCH] Support AstroPy 4.3 for tests
The FITS checking meant that a test that created a test FITS file
was no-longer valid for AstroPy, so tweak the output to appease
both AstroPy 4.3 and fverify (at least for the header lines, it
still claims the fil character is wrong but this is less important).
---
sherpa/astro/io/tests/test_io.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sherpa/astro/io/tests/test_io.py b/sherpa/astro/io/tests/test_io.py
index daa52d096d..a2bf6fdc93 100644
--- a/sherpa/astro/io/tests/test_io.py
+++ b/sherpa/astro/io/tests/test_io.py
@@ -150,8 +150,12 @@ def fake_rmf(outfile):
def hdr(key, value):
if isinstance(value, str):
value = "'{}'".format(value)
- elif isinstance(value, bool):
- value = 'T' if value else 'F'
+ else:
+ if isinstance(value, bool):
+ value = 'T' if value else 'F'
+
+ # add spacing to make FVERIFY happy
+ value = f"{str(value):>20s}"
out = "{:8s}= {}".format(key, value)
return out.ljust(80)