Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-42416: Modify without_datastore test to use file config #938

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tests/test_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2397,13 +2397,18 @@ def tearDown(self) -> None:

def test_fallback(self) -> None:
# Read the butler config and mess with the datastore section.
bad_config = Config(os.path.join(self.root, "butler.yaml"))
config_path = os.path.join(self.root, "butler.yaml")
bad_config = Config(config_path)
bad_config["datastore", "cls"] = "lsst.not.a.datastore.Datastore"
bad_config.dumpToUri(config_path)

with self.assertRaises(RuntimeError):
Butler.from_config(bad_config)
Butler(self.root, without_datastore=False)

butler = Butler.from_config(bad_config, writeable=True, without_datastore=True)
with self.assertRaises(RuntimeError):
Butler.from_config(self.root, without_datastore=False)

butler = Butler.from_config(self.root, writeable=True, without_datastore=True)
self.assertIsInstance(butler._datastore, NullDatastore)

# Check that registry is working.
Expand Down
Loading