Closed CyberiaResurrection closed 10 months ago
Running pytest to collect the tests directly results in:
(venv2) [alex@localhost traveller_pyroute]$ pytest --collect-only -m=hypothesis --pythonwarnings=ignore::pytest.PytestAssertRewriteWarning
========================================================================================================= test session starts =========================================================================================================
platform linux -- Python 3.9.17[pypy-7.3.12-final], pytest-7.4.2, pluggy-1.2.0
Using --randomly-seed=117694285
rootdir: /home/alex/gitstuf/traveller_pyroute
configfile: pytest.ini
testpaths: Tests, Tests/Pathfinding, Tests/Position
plugins: randomly-3.15.0, hypothesis-6.87.3, console-scripts-1.4.1, subtests-0.11.0
collected 236 items / 225 deselected / 11 selected
<Module Tests/Hypothesis/testSector.py>
<UnitTestCase testSector>
<TestCaseFunction test_create_sector>
<Module Tests/Hypothesis/testTradeCodes.py>
<UnitTestCase testTradeCodes>
<TestCaseFunction test_parse_text_to_trade_code>
<Module Tests/Hypothesis/testStar.py>
<UnitTestCase testStar>
<TestCaseFunction test_parse_line_to_star_and_back>
<TestCaseFunction test_parse_line_to_star>
<TestCaseFunction test_split_stellar_data>
<Module Tests/Hypothesis/testDeltaStar.py>
<UnitTestCase testDeltaStar>
<TestCaseFunction test_canonicalise_barren_worlds>
<TestCaseFunction test_canonicalise_cx_on_non_barren_worlds>
<TestCaseFunction test_canonicalise_ex_on_non_barren_worlds>
<TestCaseFunction test_canonicalise_invalid_trade_codes>
<TestCaseFunction test_canonicalise_missing_trade_codes>
<TestCaseFunction test_check_canonicalisation>
I've trimmed the warnings summary. So how come Pytest itself is collecting hypothesis tests fine, but Hypofuzz isn't?
I suspect we're misidentifying the self
argument as a place that we need a fixture:
probably classes just need special handling? They're notably more fiddly to set up though, since you have to manage instances, setup and teardown methods, etc. ...
Whoops, no, this is just that the private Hypothesis internals which HypoFuzz relies on have changed (as they're entitled to do), and so the fuzzer needs to be updated too. Tracking in #29.
Under pypy matching python 3.9, hypothesis 6.87, and I'm not sure what version of hypofuzz, I can't get hypofuzz to collect any property based tests, even when I explicitly specify them.
frinstance:
Here's the test_parse_line_to_star_and_back test, which lives in Tests/Hypothesis/testStar.py, inside the testStar class (sans the 31 examples accumulated running under classic hypothesis)
Running that test thru pytest results in pytest seeing and collecting it:
Before I get too wound up, I'd appreciate help figuring/ruling out what I've done wrong.