From 42785cca442cb747aaec707626076ab23c23b4a1 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 7 Feb 2024 22:13:23 +0200 Subject: [PATCH] Revert "testing: temporarily disable test due to hypothesis issue (#11836)" This reverts commit 5cd0535395541d8940035418b368331318002199. --- testing/python/metafunc.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index e132725e1..ed22c2b5a 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -14,6 +14,9 @@ from typing import Sequence from typing import Tuple from typing import Union +import hypothesis +from hypothesis import strategies + from _pytest import fixtures from _pytest import python from _pytest.compat import getfuncargnames @@ -26,10 +29,6 @@ from _pytest.scope import Scope import pytest -# import hypothesis -# from hypothesis import strategies - - class TestMetafunc: def Metafunc(self, func, config=None) -> python.Metafunc: # The unit tests of this class check if things work correctly @@ -294,15 +293,14 @@ class TestMetafunc: assert metafunc._calls[2].id == "x1-a" assert metafunc._calls[3].id == "x1-b" - # TODO: Uncomment - https://github.com/HypothesisWorks/hypothesis/pull/3849 - # @hypothesis.given(strategies.text() | strategies.binary()) - # @hypothesis.settings( - # deadline=400.0 - # ) # very close to std deadline and CI boxes are not reliable in CPU power - # def test_idval_hypothesis(self, value) -> None: - # escaped = IdMaker([], [], None, None, None, None, None)._idval(value, "a", 6) - # assert isinstance(escaped, str) - # escaped.encode("ascii") + @hypothesis.given(strategies.text() | strategies.binary()) + @hypothesis.settings( + deadline=400.0 + ) # very close to std deadline and CI boxes are not reliable in CPU power + def test_idval_hypothesis(self, value) -> None: + escaped = IdMaker([], [], None, None, None, None, None)._idval(value, "a", 6) + assert isinstance(escaped, str) + escaped.encode("ascii") def test_unicode_idval(self) -> None: """Test that Unicode strings outside the ASCII character set get