Skip to content

Commit 327f746

Browse files
committed
fix some tests
1 parent 64df8f4 commit 327f746

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

hypothesis-python/scripts/other-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ $PYTEST tests/redis/
3333
pip uninstall -y redis fakeredis
3434

3535
$PYTEST tests/typing_extensions/
36-
if [[ "$HYPOTHESIS_PROFILE" != "crosshair" ]]; then
37-
pip uninstall -y typing_extensions
36+
if [ "$HYPOTHESIS_PROFILE" != "crosshair" ] && [ "$(python -c 'import sys; print(sys.version_info[:2] > (3, 10))')" = "True" ]; then
37+
pip uninstall -y typing-extensions
3838
fi
3939

4040
pip install "$(grep 'annotated-types==' ../requirements/coverage.txt)"

hypothesis-python/tests/cover/test_random_module.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
)
2525
from hypothesis.errors import HypothesisWarning, InvalidArgument
2626
from hypothesis.internal import entropy
27-
from hypothesis.internal.compat import GRAALPY, PYPY
27+
from hypothesis.internal.compat import FREE_THREADED_CPYTHON, GRAALPY, PYPY
2828
from hypothesis.internal.entropy import deterministic_PRNG
2929

3030

@@ -220,7 +220,8 @@ def f():
220220

221221

222222
@pytest.mark.skipif(
223-
PYPY, reason="We can't guard against bad no-reference patterns in pypy."
223+
PYPY or FREE_THREADED_CPYTHON,
224+
reason="We can't guard against bad no-reference patterns in pypy.",
224225
)
225226
def test_passing_referenced_instance_within_function_scope_warns():
226227
def f():

hypothesis-python/tests/nocover/test_cacheable.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import pytest
1515

1616
from hypothesis import given, settings, strategies as st
17+
from hypothesis.internal.compat import FREE_THREADED_CPYTHON
1718

1819

1920
@pytest.mark.parametrize(
@@ -51,6 +52,7 @@ def test_cacheable_things_are_cached():
5152
assert st.tuples(x) == st.tuples(x)
5253

5354

55+
@pytest.mark.skipif(FREE_THREADED_CPYTHON, reason="gc differences")
5456
def test_local_types_are_garbage_collected_issue_493():
5557
store = None
5658

hypothesis-python/tests/nocover/test_recursive.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import pytest
1616

1717
from hypothesis import HealthCheck, given, settings, strategies as st
18+
from hypothesis.internal.compat import FREE_THREADED_CPYTHON
1819

1920
from tests.common.debug import find_any, minimal
2021
from tests.common.utils import Why, flaky, xfail_on_crosshair
@@ -174,6 +175,7 @@ def test_self_ref_regression(_):
174175
pass
175176

176177

178+
@pytest.mark.skipif(FREE_THREADED_CPYTHON, reason="gc differences")
177179
@flaky(min_passes=1, max_runs=2)
178180
def test_gc_hooks_do_not_cause_unraisable_recursionerror(testdir):
179181
# We were concerned in #3979 that we might see bad results from a RecursionError

0 commit comments

Comments
 (0)