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
importpytestifnotpytest.config.getoption("--custom-flag"):
pytest.skip("--custom-flag is missing, skipping tests", allow_module_level=True)
It seems like pytest.config no longer exists or isn't accessible in this way. This doc should be updated to reflect the current way this would be achieved, or removed if it's not possible. I'm using pytest 3.9.1 but this may have changed in an earlier version.
The text was updated successfully, but these errors were encountered:
That shows the problem with exposing pytest.config and pytest.item, they are installed at runtime and depends on the order the hooks execute. We should update the example to not use pytest.config, given that the purpose of the example is to showcase pytest.skip at module level anyway.
Under https://docs.pytest.org/en/latest/skipping.html#skipping-test-functions there's a snippet that demonstrates skipping at the module level.
It seems like
pytest.config
no longer exists or isn't accessible in this way. This doc should be updated to reflect the current way this would be achieved, or removed if it's not possible. I'm using pytest 3.9.1 but this may have changed in an earlier version.The text was updated successfully, but these errors were encountered: