diff --git a/Lib/test/support/hypothesis_helper.py b/Lib/test/support/hypothesis_helper.py index a99a4963ffecc94..9223ec1eaee4734 100644 --- a/Lib/test/support/hypothesis_helper.py +++ b/Lib/test/support/hypothesis_helper.py @@ -1,5 +1,7 @@ import os +from test.support import mark + try: import hypothesis except ImportError: @@ -51,3 +53,5 @@ ), ) hypothesis.settings.load_profile("cpython-local-dev") + +mark_hypothesis = mark("hypothesis") diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py index 82eabf4bb06b2ff..dc63e082fccc8a5 100644 --- a/Lib/test/test_binascii.py +++ b/Lib/test/test_binascii.py @@ -5,7 +5,7 @@ import array import re from test.support import bigmemtest, _1G, _4G -from test.support.hypothesis_helper import hypothesis +from test.support.hypothesis_helper import hypothesis, mark_hypothesis # Note: "*_hex" functions are aliases for "(un)hexlify" @@ -265,6 +265,7 @@ def test_uu(self): binary=hypothesis.strategies.binary(max_size=45), backtick=hypothesis.strategies.booleans(), ) + @mark_hypothesis def test_b2a_roundtrip(self, binary, backtick): converted = binascii.b2a_uu(self.type2test(binary), backtick=backtick) restored = binascii.a2b_uu(self.type2test(converted)) @@ -308,6 +309,7 @@ def test_hex(self): self.assertEqual(binascii.unhexlify(self.type2test(t)), u) @hypothesis.given(binary=hypothesis.strategies.binary()) + @mark_hypothesis def test_hex_roundtrip(self, binary): converted = binascii.hexlify(self.type2test(binary)) restored = binascii.unhexlify(self.type2test(converted)) @@ -433,6 +435,7 @@ def test_qp(self): istext=hypothesis.strategies.booleans(), header=hypothesis.strategies.booleans(), ) + @mark_hypothesis def test_b2a_qp_a2b_qp_round_trip(self, binary, quotetabs, istext, header): converted = binascii.b2a_qp( self.type2test(binary), @@ -504,6 +507,7 @@ def test_b2a_base64_newline(self): binary=hypothesis.strategies.binary(), newline=hypothesis.strategies.booleans(), ) + @mark_hypothesis def test_base64_roundtrip(self, binary, newline): converted = binascii.b2a_base64(self.type2test(binary), newline=newline) restored = binascii.a2b_base64(self.type2test(converted)) diff --git a/Lib/test/test_math_property.py b/Lib/test/test_math_property.py index 7d51aa17b4cc270..a4b901fb4d4f359 100644 --- a/Lib/test/test_math_property.py +++ b/Lib/test/test_math_property.py @@ -1,9 +1,11 @@ import functools import unittest from math import isnan, nextafter -from test.support import requires_IEEE_754 +from test.support import requires_IEEE_754, mark_module from test.support.hypothesis_helper import hypothesis +mark_module('hypothesis') + floats = hypothesis.strategies.floats integers = hypothesis.strategies.integers diff --git a/Lib/test/test_tools/test_makeunicodedata.py b/Lib/test/test_tools/test_makeunicodedata.py index f31375117e2e926..3f34584239d70c0 100644 --- a/Lib/test/test_tools/test_makeunicodedata.py +++ b/Lib/test/test_tools/test_makeunicodedata.py @@ -1,7 +1,7 @@ import unittest from test.test_tools import skip_if_missing, imports_under_tool from test import support -from test.support.hypothesis_helper import hypothesis +from test.support.hypothesis_helper import hypothesis, mark_hypothesis st = hypothesis.strategies given = hypothesis.given @@ -115,6 +115,7 @@ def test_forbid_empty_dawg(self): ("ab", "1"), ] ) + @mark_hypothesis def test_dawg(self, data): # suppress debug prints with support.captured_stdout() as output: diff --git a/Lib/test/test_zoneinfo/test_zoneinfo_property.py b/Lib/test/test_zoneinfo/test_zoneinfo_property.py index c00815e2fd4c364..78bb8098bb56ba1 100644 --- a/Lib/test/test_zoneinfo/test_zoneinfo_property.py +++ b/Lib/test/test_zoneinfo/test_zoneinfo_property.py @@ -5,10 +5,13 @@ import unittest import zoneinfo +from test.support import mark_module from test.support.hypothesis_helper import hypothesis import test.test_zoneinfo._support as test_support +mark_module('hypothesis') + ZoneInfoTestBase = test_support.ZoneInfoTestBase py_zoneinfo, c_zoneinfo = test_support.get_modules()