Skip to content

Commit

Permalink
Clarify PipelineStepTester output for empty suffix.
Browse files Browse the repository at this point in the history
The original output format assumed a non-empty suffix, but this leads
to a confusing "()" if the full pipeline is tested at once.
  • Loading branch information
kfindeisen committed Apr 18, 2024
1 parent ab90f2f commit 2d0dd30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/lsst/pipe/base/tests/pipelineStepTester.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ def run(self, butler: Butler, test_case: unittest.TestCase) -> None:
butler.registry.registerDatasetType(node.dataset_type)

if not pure_inputs.keys() <= self.expected_inputs:
missing = [f"{k} ({pure_inputs[k]})" for k in pure_inputs.keys() - self.expected_inputs]
missing = []
for type_name in pure_inputs.keys() - self.expected_inputs:
suffix = pure_inputs[type_name]
missing.append(type_name + (f" ({suffix})" if suffix else ""))

Check warning on line 163 in python/lsst/pipe/base/tests/pipelineStepTester.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/tests/pipelineStepTester.py#L160-L163

Added lines #L160 - L163 were not covered by tests
raise AssertionError(f"Got unexpected pure_inputs: {missing}")

if not all_outputs.keys() >= self.expected_outputs:
Expand Down

0 comments on commit 2d0dd30

Please sign in to comment.