File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
infrahub_sdk/pytest_plugin/items Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,11 @@ def instantiate_check(self) -> None:
3737 str (self .resource_config .file_path .parent ) if self .resource_config .file_path .parent != Path () else None # type: ignore[attr-defined]
3838 )
3939
40- self . check_instance = self .resource_config .load_class ( # type: ignore[attr-defined]
40+ check_class = self .resource_config .load_class ( # type: ignore[attr-defined]
4141 import_root = self .repository_base , relative_path = relative_path
4242 )
43+ client = self .session .infrahub_client # type: ignore[attr-defined]
44+ self .check_instance = check_class (branch = client .default_branch , client = client )
4345
4446 def run_check (self , variables : dict [str , Any ]) -> Any :
4547 self .instantiate_check ()
Original file line number Diff line number Diff line change @@ -36,9 +36,11 @@ def instantiate_transform(self) -> None:
3636 relative_path = (
3737 str (self .resource_config .file_path .parent ) if self .resource_config .file_path .parent != Path () else None # type: ignore[attr-defined]
3838 )
39- self . transform_instance = self .resource_config .load_class ( # type: ignore[attr-defined]
39+ transform_class = self .resource_config .load_class ( # type: ignore[attr-defined]
4040 import_root = self .repository_base , relative_path = relative_path
4141 )
42+ client = self .session .infrahub_client # type: ignore[attr-defined]
43+ self .transform_instance = transform_class (branch = client .default_branch , client = client )
4244
4345 def run_transform (self , variables : dict [str , Any ]) -> Any :
4446 self .instantiate_transform ()
You can’t perform that action at this time.
0 commit comments