Ensure Config.inifile is available during pytest_cmdline_main#9400
Ensure Config.inifile is available during pytest_cmdline_main#9400nicoddemus merged 2 commits intopytest-dev:mainfrom
Conversation
src/_pytest/legacypath.py
Outdated
|
|
||
| @pytest.hookimpl | ||
| def pytest_configure(config: pytest.Config) -> None: | ||
| def pytest_load_initial_conftests(early_config: pytest.Config) -> None: |
There was a problem hiding this comment.
Changing to pytest_load_initial_conftests to monkey patch the attributes as it executes earlier than pytest_configure.
| @pytest.hookimpl | ||
| def pytest_configure(config: pytest.Config) -> None: | ||
| """Installs the LegacyTmpdirPlugin if the ``tmpdir`` plugin is also installed.""" | ||
| if config.pluginmanager.has_plugin("tmpdir"): |
There was a problem hiding this comment.
The LegacyTmpdirPlugin should be installed during pytest_configure as that's called after tmpdir is installed.
4098fc2 to
23c38b3
Compare
23c38b3 to
9510bd7
Compare
| hc = pm.hook.pytest_load_initial_conftests | ||
| values = hc._nonwrappers + hc._wrappers | ||
| expected = [ | ||
| assert [x.function.__module__ for x in hc._nonwrappers] == [ |
There was a problem hiding this comment.
Decided to also split checking wrappers and non-wrappers, seems better to explicitly test them separately.
76d1c6d to
ef086a3
Compare
|
@RonnyPfannschmidt gentle ping. 👍 |
|
I've held back merging this as I wasn't sure if we preferred to revert the plugin entirely or not - with #9438 I assume we decided to keep it, but this conflicts now due to the import changes. After the conflicts are resolved I think this is good to go. Thanks @nicoddemus and happy new year! 🎉 |
|
I will fix this later today or tomorrow the latest! Happy new year! |
…dering Seems better to test which one is which explicitly.
ef086a3 to
696f955
Compare
Fix #9396