Skip to content

Commit bff38de

Browse files
committed
more tweaks
1 parent eac1359 commit bff38de

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

hypothesis-python/src/hypothesis/strategies/_internal/datetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def timezone_keys(
424424
with warnings.catch_warnings():
425425
try:
426426
warnings.simplefilter("ignore", EncodingWarning)
427-
except NameError:
427+
except NameError: # pragma: no cover
428428
pass
429429
# On Python 3.12 (and others?), `available_timezones()` opens files
430430
# without specifying an encoding - which our selftests make an error.

tooling/src/hypothesistooling/__main__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,12 @@ def run_tox(task, version, *args):
606606

607607
env["PATH"] = os.path.dirname(python) + ":" + env["PATH"]
608608
# Set environment variable for tox to use in basepython substitution
609-
env["TOX_PYTHON_VERSION"] = ALIASES[version]
609+
if version.startswith("pypy"):
610+
# For PyPy, use the version name from e.g. "pypy3.11-7.3.20"
611+
# to match tox's environment name inference.
612+
env["TOX_PYTHON_VERSION"] = version.split("-")[0] # "pypy3.11"
613+
else:
614+
env["TOX_PYTHON_VERSION"] = ALIASES[version] # "python3.12"
610615
print(env["PATH"])
611616

612617
pip_tool("tox", "-e", task, *args, env=env, cwd=hp.HYPOTHESIS_PYTHON)

0 commit comments

Comments
 (0)