Skip to content

Commit

Permalink
Convert test_background to use subTest
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkannawadi committed Dec 20, 2023
1 parent 70fb0df commit f8b7366
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_validate_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ def test_background(self):
bg_mean = bg0_arr.mean(dtype=np.float64)
bg_std = bg0_arr.std(dtype=np.float64)

self.assertAlmostEqual(bg_mean, 179.2837806173611, places=7, msg="calexpBackground mean")
self.assertAlmostEqual(bg_std, 0.8294872758615469, places=7, msg="calexpBackground stddev")
for name, var, val in (
("calexpBackground mean", bg_mean, 179.2837806173611),
("calexpBackground stddev", bg_std, 0.8294872758615469),
):
with self.subTest(name):
self.assertAlmostEqual(var, val, places=7, msg=name)

def test_ic_src(self):
"""Test icSrc catalog."""
Expand Down

0 comments on commit f8b7366

Please sign in to comment.