|
14 | 14 | from typing import Tuple
|
15 | 15 | from typing import Union
|
16 | 16 |
|
| 17 | +import hypothesis |
| 18 | +from hypothesis import strategies |
| 19 | + |
17 | 20 | from _pytest import fixtures
|
18 | 21 | from _pytest import python
|
19 | 22 | from _pytest.compat import getfuncargnames
|
|
26 | 29 | import pytest
|
27 | 30 |
|
28 | 31 |
|
29 |
| -# import hypothesis |
30 |
| -# from hypothesis import strategies |
31 |
| - |
32 |
| - |
33 | 32 | class TestMetafunc:
|
34 | 33 | def Metafunc(self, func, config=None) -> python.Metafunc:
|
35 | 34 | # The unit tests of this class check if things work correctly
|
@@ -294,15 +293,14 @@ class A:
|
294 | 293 | assert metafunc._calls[2].id == "x1-a"
|
295 | 294 | assert metafunc._calls[3].id == "x1-b"
|
296 | 295 |
|
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") |
306 | 304 |
|
307 | 305 | def test_unicode_idval(self) -> None:
|
308 | 306 | """Test that Unicode strings outside the ASCII character set get
|
|
0 commit comments