Skip to content

Commit

Permalink
add hasattr to the module parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Oct 15, 2024
1 parent c28c7c4 commit c2e8553
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dodal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def make_all_devices(
"""
if isinstance(module, str) or module is None:
module = import_module(module or __name__)
if module.CONTROLLED_COLLECTION:
if hasattr(module, "CONTROLLED_COLLECTION") and module.CONTROLLED_COLLECTION:
return make_all_controlled_devices(module, include_skipped, **kwargs)

Check warning on line 115 in src/dodal/utils.py

View check run for this annotation

Codecov / codecov/patch

src/dodal/utils.py#L115

Added line #L115 was not covered by tests
factories = collect_factories(module, include_skipped)
devices: tuple[dict[str, AnyDevice], dict[str, Exception]] = invoke_factories(
Expand Down

0 comments on commit c2e8553

Please sign in to comment.