Skip to content

Commit

Permalink
Make test check all warnings for desired one
Browse files Browse the repository at this point in the history
This may not be the first or only warning on the stack.
  • Loading branch information
parejkoj committed Mar 12, 2024
1 parent 1d79ad6 commit c3bd699
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ def testNoAperCorrMap(self):
calibTask = CalibrateTask(config=calibConfig)
with self.assertLogs(level=logging.WARNING) as cm:
_ = calibTask.run(charImResults.exposure)
self.assertIn("Image does not have valid aperture correction map", cm.output[0])
# Other warnings may also be emitted.
warnings = '\n'.join(cm.output)
self.assertIn("Image does not have valid aperture correction map", warnings)


def setup_module(module):
Expand Down

0 comments on commit c3bd699

Please sign in to comment.