We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc61aff commit c463cceCopy full SHA for c463cce
infrahub_sdk/checks.py
@@ -189,6 +189,11 @@ def get_check_class_instance(
189
try:
190
spec = importlib.util.spec_from_file_location(check_config.class_name, search_location)
191
module = importlib.util.module_from_spec(spec) # type: ignore[arg-type]
192
+
193
+ # Set base module for relative import. This is useful when pytest plugin runs through proposed change pipeline,
194
+ # as pytest is invoked outside of the imported repository.
195
+ module.__package__ = str(search_location.parent)
196
197
spec.loader.exec_module(module) # type: ignore[union-attr]
198
199
# Get the specified class from the module
0 commit comments