-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The plugin hooks pytest_cmdline_parse and pytest_load_initial_conftests don't appear to get called #2616
Comments
Hi @ceridwen, Where is |
In this case, |
Am having the same problem using pytest 3.3.1 and python 2.7.12. I created a basic setup similar to @ceridwen with one directory containing |
Looking at the code I see that this is how it works right now: I don't see how it would be possible to make pytest call those hooks for Opened #3091 to fix the docs. Thanks guys for the report! |
I have a conftest.py I've been using to try to test the available hook functions.
The values for pytest_cmdline_main and pytest_cmdline_preparse never get printed, so I think they're not being called. When I look in the debugger, the latter hooks seem to be called by the line
pytest/_pytest/config.py
Line 167 in 81ad185
The only hook at this point is
_pytest.config.Config.pytest_cmdline_parse
, which gets called. Later on, the hook in my conftest.py is added, but I don't think this list of hooks is examined again after this initial call. Having__init__.py
in the directory or not doesn't seem to matter, the first two hooks don't get executed. I haven't checked more complicated possible package configurations.If this is intended behavior, it's not very transparent, and the documentation doesn't explain what's needed to get the first two hooks actually called.
This is on MacOS X 10.12.5 and Python 3.6 installed with Homebrew.
The text was updated successfully, but these errors were encountered: