hypofuzz icon indicating copy to clipboard operation
hypofuzz copied to clipboard

hypofuzz isn't compatible with current versions of pytest

Open tarunik opened this issue 1 year ago • 2 comments

When trying to run hypofuzz, I get this error:

<rest of backtrace snipped as it doesn't say much about what's broken>
INTERNALERROR>   File "~/project/.tox/fuzz/lib/python3.11/site-packages/hypofuzz/interface.py", line 40, in pytest_collection_finish
INTERNALERROR>     all_autouse = set(manager._getautousenames(item.nodeid))
INTERNALERROR>                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "~/project/.tox/fuzz/lib/python3.11/site-packages/_pytest/fixtures.py", line 1502, in _getautousenames
INTERNALERROR>     for parentnode in node.listchain():
INTERNALERROR>                       ^^^^^^^^^^^^^^
INTERNALERROR> AttributeError: 'str' object has no attribute 'listchain'

As it turns out, _getautousenames takes an Item in current/recent versions of pytest, not a string nodeid. I experienced this with Hypofuzz 24.2.3, Hypothesis 6.100.1, and PyTest 8.1.1, although the bug still appears to be present at HEAD.

tarunik avatar Apr 13 '24 20:04 tarunik

Update: downgrading PyTest to 8.0.2 made this issue stop happening (but is not a permanent solution for me since it breaks other parts of my testsuite).

tarunik avatar Apr 14 '24 18:04 tarunik

Can confirm that the same issue happens with pytest version 8.2.1 and hypofuzz 24.2.3 .

eivindjahren avatar Jun 12 '24 12:06 eivindjahren

Can confirm this same problem with pytest 8.3.3 and hypofuzz 24.2.3.

I've created a minimal reproduction of the problem: https://github.com/johnchristopherjones/hypofuzz-pytest-version

johnchristopherjones avatar Sep 20 '24 18:09 johnchristopherjones