Skip to content

Commit 101328a

Browse files
authored
Merge pull request #11947 from bluetech/hypothesis-revert
Revert "testing: temporarily disable test due to hypothesis issue (#1836)"
2 parents 6c0b6c2 + 42785cc commit 101328a

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

testing/python/metafunc.py

+11-13
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
from typing import Tuple
1515
from typing import Union
1616

17+
import hypothesis
18+
from hypothesis import strategies
19+
1720
from _pytest import fixtures
1821
from _pytest import python
1922
from _pytest.compat import getfuncargnames
@@ -26,10 +29,6 @@
2629
import pytest
2730

2831

29-
# import hypothesis
30-
# from hypothesis import strategies
31-
32-
3332
class TestMetafunc:
3433
def Metafunc(self, func, config=None) -> python.Metafunc:
3534
# The unit tests of this class check if things work correctly
@@ -294,15 +293,14 @@ class A:
294293
assert metafunc._calls[2].id == "x1-a"
295294
assert metafunc._calls[3].id == "x1-b"
296295

297-
# TODO: Uncomment - https://github.com/HypothesisWorks/hypothesis/pull/3849
298-
# @hypothesis.given(strategies.text() | strategies.binary())
299-
# @hypothesis.settings(
300-
# deadline=400.0
301-
# ) # very close to std deadline and CI boxes are not reliable in CPU power
302-
# def test_idval_hypothesis(self, value) -> None:
303-
# escaped = IdMaker([], [], None, None, None, None, None)._idval(value, "a", 6)
304-
# assert isinstance(escaped, str)
305-
# escaped.encode("ascii")
296+
@hypothesis.given(strategies.text() | strategies.binary())
297+
@hypothesis.settings(
298+
deadline=400.0
299+
) # very close to std deadline and CI boxes are not reliable in CPU power
300+
def test_idval_hypothesis(self, value) -> None:
301+
escaped = IdMaker([], [], None, None, None, None, None)._idval(value, "a", 6)
302+
assert isinstance(escaped, str)
303+
escaped.encode("ascii")
306304

307305
def test_unicode_idval(self) -> None:
308306
"""Test that Unicode strings outside the ASCII character set get

0 commit comments

Comments
 (0)