Skip to content

Commit 7f80a99

Browse files
committed
get tests passing
1 parent e6926e1 commit 7f80a99

7 files changed

Lines changed: 33 additions & 10 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
- check-quality
9191
- check-pytest62
9292
- check-pytest62
93-
- check-django51
93+
- check-django60
9494
- check-django42
9595
- check-pandas22
9696
- check-pandas21

hypothesis-python/docs/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,7 @@ This patch fixes a significant slowdown when using the :func:`~hypothesis.statef
27442744
6.100.2 - 2024-04-28
27452745
--------------------
27462746

2747-
Explicitly cast :obj:`numpy.finfo.smallest_normal` to builtin `float` in
2747+
Explicitly cast :obj:`numpy.finfo.smallest_normal <numpy.finfo>` to builtin `float` in
27482748
preparation for the :pypi:`numpy==2.0 <numpy>` release (:issue:`3950`)
27492749

27502750
.. _v6.100.1:

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import datetime as dt
1212
import operator as op
13+
import warnings
1314
import zoneinfo
1415
from calendar import monthrange
1516
from functools import cache, partial
@@ -420,7 +421,14 @@ def timezone_keys(
420421
# check_type(bool, allow_deprecated, "allow_deprecated")
421422
check_type(bool, allow_prefix, "allow_prefix")
422423

423-
available_timezones = ("UTC", *sorted(zoneinfo.available_timezones()))
424+
with warnings.catch_warnings():
425+
try:
426+
warnings.simplefilter("ignore", EncodingWarning)
427+
except NameError:
428+
pass
429+
# On Python 3.12 (and others?), `available_timezones()` opens files
430+
# without specifying an encoding - which our selftests make an error.
431+
available_timezones = ("UTC", *sorted(zoneinfo.available_timezones()))
424432

425433
# TODO: filter out alias and deprecated names if disallowed
426434

hypothesis-python/tests/crosshair/test_crosshair.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ def test_crosshair_works_for_all_verbosities(verbosity):
2828
# check that we aren't realizing symbolics early in debug prints and killing
2929
# test effectiveness.
3030
@given(st.integers())
31-
@settings(backend="crosshair", deadline=1000, verbosity=verbosity, database=None)
31+
@settings(
32+
backend="crosshair",
33+
deadline=1000,
34+
verbosity=verbosity,
35+
derandomize=True,
36+
max_examples=1000,
37+
phases=[Phase.generate],
38+
)
3239
def f(n):
3340
assert n != 123456
3441

@@ -40,7 +47,13 @@ def f(n):
4047
def test_crosshair_works_for_all_verbosities_data(verbosity):
4148
# data draws have their own print path
4249
@given(st.data())
43-
@settings(backend="crosshair", verbosity=verbosity, database=None)
50+
@settings(
51+
backend="crosshair",
52+
verbosity=verbosity,
53+
derandomize=True,
54+
max_examples=1000,
55+
phases=[Phase.generate],
56+
)
4457
def f(data):
4558
n = data.draw(st.integers())
4659
assert n != 123456

hypothesis-python/tests/nocover/test_recursive.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ def test_self_ref_regression(_):
163163
pass
164164

165165

166+
@pytest.mark.skipif(sys.version_info >= (3, 14), reason="gc changes")
166167
@xfail_if_gil_disabled
167168
@flaky(min_passes=1, max_runs=2)
168169
def test_gc_hooks_do_not_cause_unraisable_recursionerror(testdir):

hypothesis-python/tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,17 @@ commands =
182182
niche: bash scripts/other-tests.sh
183183
custom: python -bb -X dev -m pytest {posargs}
184184

185-
[testenv:django{42,51,52,-nocontrib}]
185+
[testenv:django{42,52,60,-nocontrib}]
186186
setenv=
187187
PYTHONWARNDEFAULTENCODING=1
188188
DJANGO_SETTINGS_MODULE=tests.django.toys.settings.settings
189189
nocontrib: DJANGO_SETTINGS_MODULE=tests.django.toys.settings.settings_no_contrib
190190
deps=
191191
-r../requirements/test.txt
192192
django42: django==4.2.27
193-
django51: django==5.1.14
194193
django52: django==5.2.9
195-
django-nocontrib: django==5.2.9
194+
django60: django==6.0.0
195+
django-nocontrib: django==6.0.0
196196
commands =
197197
python -bb -X dev -m tests.django.manage test tests.django {posargs}
198198

tooling/src/hypothesistooling/__main__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,11 @@ def standard_tox_task(name, py=ci_version):
687687
# standard_tox_task("py310-pytest46", py="3.10")
688688
standard_tox_task("pytest62")
689689

690+
dj_version = max(ci_version, "3.12")
690691
for n in DJANGO_VERSIONS:
691-
standard_tox_task(f"django{n.replace('.', '')}")
692+
standard_tox_task(f"django{n.replace('.', '')}", py=dj_version)
692693
# we also test no-contrib on the latest django version
693-
standard_tox_task("django-nocontrib")
694+
standard_tox_task("django-nocontrib", py=dj_version)
694695

695696
for n in [13, 14, 15, 20, 21, 22]:
696697
standard_tox_task(f"pandas{n}")

0 commit comments

Comments
 (0)