Skip to content

Commit

Permalink
Fix test_py_info to work on Python 3.11 too
Browse files Browse the repository at this point in the history
The test failure is a result of BPO 45413.

Fixes #2344
  • Loading branch information
rkucsora authored and gaborbernat committed Jul 23, 2022
1 parent b2a9579 commit 9118385
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/unit/discovery/py_info/test_py_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ def test_custom_venv_install_scheme_is_prefered(mocker):
"venv": venv_scheme,
}
if getattr(sysconfig, "get_preferred_scheme", None):
sysconfig_install_schemes[sysconfig.get_preferred_scheme("prefix")] = default_scheme
# define the prefix as sysconfig.get_preferred_scheme did before 3.11
sysconfig_install_schemes["nt" if os.name == "nt" else "posix_prefix"] = default_scheme

if sys.version_info[0] == 2:
sysconfig_install_schemes = _stringify_schemes_dict(sysconfig_install_schemes)
Expand Down

0 comments on commit 9118385

Please sign in to comment.