diff --git a/tests/conftest.py b/tests/conftest.py index 80303a14f..c4ca472ff 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,6 +10,7 @@ import shutil import subprocess import sys +import sysconfig import tempfile import warnings @@ -77,6 +78,7 @@ def tmp_path_session(tmp_path_factory): class VEnv(EnvBuilder): def __init__(self, env_dir): super().__init__(symlinks=True, with_pip=True) + # This warning is mistakenly generated by CPython 3.11.0 # https://github.com/python/cpython/pull/98743 with warnings.catch_warnings(): @@ -84,6 +86,10 @@ def __init__(self, env_dir): warnings.filterwarnings('ignore', 'check_home argument is deprecated and ignored.', DeprecationWarning) self.create(env_dir) + # Free-threaded Python 3.13 requires pip 24.1b1 or later. + if sysconfig.get_config_var('Py_GIL_DISABLED'): + self.pip('install', '--upgrade', 'pip >= 24.1b1') + def ensure_directories(self, env_dir): context = super().ensure_directories(env_dir) # Store the path to the venv Python interpreter. There does