You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating pytest-socket to the 0.5.0 version, I cannot use pytest-socket (0.5.0) and pytest-flakes (4.0.5) together.
I see the following error:
item = <FlakesItem flake-8>
def pytest_runtest_setup(item) -> None:
"""During each test item's setup phase,
choose the behavior based on the configurations supplied.
This is the bulk of the logic for the plugin.
As the logic can be extensive, this method is allowed complexity.
It may be refactored in the future to be more readable.
"""
# If test has the `enable_socket` marker, we accept this as most explicit.
> if "socket_enabled" in item.fixturenames or item.get_closest_marker(
"enable_socket"
):
E AttributeError: 'FlakesItem' object has no attribute 'fixturenames'
The 0.4.1 version working well.
The text was updated successfully, but these errors were encountered:
Thanks for the report, @niksite ! It makes sense that the change in 0.5.0 would be relevant - the change from an autouse fixture to using pytest hooks is where this is happening.
I haven't tried using this plugin along with pytest-flakes - it's not one of the tools in my toolbox right now.
According to the docs, the signature expected to be passed into this function should be an Item, and that's what I'm inspecting.
From this thread on pytest, it looks like the conversation resolves in that the custom object FlakesItem ought to implement the behavior.
Another approach surfaced was running with the flag --fixtures-per-test - maybe that would work for you?
After updating pytest-socket to the 0.5.0 version, I cannot use pytest-socket (0.5.0) and pytest-flakes (4.0.5) together.
I see the following error:
The 0.4.1 version working well.
The text was updated successfully, but these errors were encountered: