diff --git a/src/ansible_compat/runtime.py b/src/ansible_compat/runtime.py index bbb5a151..89902182 100644 --- a/src/ansible_compat/runtime.py +++ b/src/ansible_compat/runtime.py @@ -238,7 +238,7 @@ def warning( def _add_sys_path_to_collection_paths(self) -> None: """Add the sys.path to the collection paths.""" - if not self.isolated and self.config.collections_scan_sys_path: + if self.config.collections_scan_sys_path: for path in sys.path: if ( path not in self.config.collections_paths diff --git a/test/test_runtime_scan_path.py b/test/test_runtime_scan_path.py index 4cdaab1b..be44f1cd 100644 --- a/test/test_runtime_scan_path.py +++ b/test/test_runtime_scan_path.py @@ -23,7 +23,6 @@ class ScanSysPath: """Parameters for scan tests.""" - isolated: bool scan: bool raises_not_found: bool @@ -38,10 +37,8 @@ def __str__(self) -> str: @pytest.mark.parametrize( ("param"), ( - ScanSysPath(isolated=True, scan=True, raises_not_found=True), - ScanSysPath(isolated=True, scan=False, raises_not_found=True), - ScanSysPath(isolated=False, scan=True, raises_not_found=False), - ScanSysPath(isolated=False, scan=False, raises_not_found=True), + ScanSysPath(scan=False, raises_not_found=True), + ScanSysPath(scan=True, raises_not_found=False), ), ids=str, ) @@ -87,7 +84,7 @@ def test_scan_sys_path( f""" import json; from ansible_compat.runtime import Runtime; - r = Runtime(isolated={param.isolated}); + r = Runtime(); fv, cp = r.require_collection(name="{V2_COLLECTION_FULL_NAME}", version="{V2_COLLECTION_VERSION}", install=False); print(json.dumps({{"found_version": str(fv), "collection_path": str(cp)}})); """, diff --git a/tox.ini b/tox.ini index e9613ee7..e6c42071 100644 --- a/tox.ini +++ b/tox.ini @@ -71,7 +71,7 @@ setenv = PIP_DISABLE_PIP_VERSION_CHECK = 1 PIP_CONSTRAINT = {toxinidir}/requirements.txt PRE_COMMIT_COLOR = always - PYTEST_REQPASS = 93 + PYTEST_REQPASS = 91 FORCE_COLOR = 1 allowlist_externals = ansible