Skip to content

Commit

Permalink
Fix test typo and work around fallout.
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo committed Sep 9, 2022
1 parent 1e93263 commit aadd939
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,13 @@ def testPruneCollections(self):
# Try to delete RUN collections, which should fail with complete
# rollback because they're still referenced by the CHAINED
# collection.
with self.assertRaises(Exception):
butler.pruneCollection(run1, pruge=True, unstore=True)
with self.assertRaises(Exception):
butler.pruneCollection(run2, pruge=True, unstore=True)
if self.datastoreStr != ["datastore='InMemory"]:
# There is a subtle bug in InMemoryDatastore in these calls to
# pruneCollection; see DM-36172 for details.
with self.assertRaises(sqlalchemy.exc.IntegrityError):
butler.pruneCollection(run1, purge=True, unstore=True)
with self.assertRaises(sqlalchemy.exc.IntegrityError):
butler.pruneCollection(run2, purge=True, unstore=True)
self.assertCountEqual(set(butler.registry.queryDatasets(..., collections=...)), [ref1, ref2, ref3])
existence = butler.datastore.mexists([ref1, ref2, ref3])
self.assertTrue(existence[ref1])
Expand Down

0 comments on commit aadd939

Please sign in to comment.