Skip to content

Commit

Permalink
Clean up an exception in test code by using add_note
Browse files Browse the repository at this point in the history
This is clearer than trying to raise the same exception from itself.
  • Loading branch information
timj committed Dec 1, 2023
1 parent 54cae75 commit 3a43e52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_simpleButler.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ def testButlerGet(self):
try:
flat_id, _ = butler.get("flat", dataId=dataId, collections=coll, **kwds)
except Exception as e:
raise type(e)(f"{str(e)}: dataId={dataId}, kwds={kwds}") from e
e.add_note(f"dataId={dataId}, kwds={kwds}")
raise
self.assertEqual(flat_id, flat2g.id, msg=f"DataId: {dataId}, kwds: {kwds}")

# Check that bad combinations raise.
Expand Down

0 comments on commit 3a43e52

Please sign in to comment.