Skip to content

Commit b0df467

Browse files
fix: properly check source file type in test suite (#25)
1 parent 338aa1f commit b0df467

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • snakemake_interface_software_deployment_plugins

snakemake_interface_software_deployment_plugins/tests.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,15 @@ def test_identity_attributes(self):
129129

130130
def test_source_path_attributes(self):
131131
spec = self.get_env_spec()
132+
133+
def is_source_file_or_none(attr: str) -> bool:
134+
val = getattr(spec, attr)
135+
return val is None or isinstance(val, EnvSpecSourceFile)
136+
132137
assert all(
133138
isinstance(attr, str)
134139
and hasattr(spec, attr)
135-
and isinstance(getattr(spec, attr), (EnvSpecSourceFile, None))
140+
and is_source_file_or_none(attr)
136141
for attr in spec.source_path_attributes()
137142
), "bug in plugin: all source path attributes must be of type EnvSpecSourceFile"
138143

0 commit comments

Comments
 (0)