File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import pytest
88
99from usethis ._backend .uv .call import call_uv_subprocess
10- from usethis ._config import usethis_config
10+ from usethis ._config import BACKEND_DEFAULT , usethis_config
1111from usethis ._console import _cached_warn_print , get_icon_mode
1212from usethis ._file .pyproject_toml .io_ import PyprojectTOMLManager
1313from usethis ._subprocess import call_subprocess
1414from usethis ._test import change_cwd , is_offline
1515from usethis ._tool .impl .spec .import_linter import _importlinter_warn_no_packages_found
16+ from usethis ._types .backend import BackendEnum
1617
1718if "UV_PYTHON" in os .environ :
1819 # To allow test subprocesses to use different versions of Python than the one
@@ -27,6 +28,9 @@ def clear_functools_caches():
2728 _cached_warn_print .cache_clear ()
2829 get_icon_mode .cache_clear ()
2930 _importlinter_warn_no_packages_found .cache_clear ()
31+ # Reset backend state to prevent stale inferred_backend from contaminating tests.
32+ usethis_config .backend = BackendEnum (BACKEND_DEFAULT )
33+ usethis_config .inferred_backend = None
3034
3135
3236@pytest .fixture (scope = "session" )
You can’t perform that action at this time.
0 commit comments