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
Refactor pytest_pycollect_makeitems #421
Refactor pytest_pycollect_makeitems #421
Commits on Oct 4, 2022
-
refactor: Extracted logic for marking tests in auto mode into pytest_…
…collection_modifyitems. pytest_pycollect_makeitem currently calls `Collector._genfunctions`, in order to delegate further collection of test items to the current pytest collector. It does so only to add the asyncio mark to async tests after the items have been collected. Rather than relying on a call to the protected `Collector._genfunctions` method the marking logic was moved to the pytest_collection_modifyitems hook, which is called at the end of the collection phase. This change removes the call to protected functions and makes the code easier to understand. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Configuration menu - View commit details
-
Copy full SHA for 3f18811 - Browse repository at this point
Copy the full SHA 3f18811View commit details -
refactor: Hoist up check for asyncio mode before trying to modify fun…
…ction items. pytest_collection_modifyitems has no effect when asyncio mode is not set to AUTO. Moving the mode check out of the loop prevents unnecessary work. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Configuration menu - View commit details
-
Copy full SHA for f25c5cc - Browse repository at this point
Copy the full SHA f25c5ccView commit details
Commits on Oct 8, 2022
-
refactor: Renamed _set_explicit_asyncio_mark and _has_explicit_asynci…
…o_mark to _make_asyncio_fixture_function and _is_asyncio_fixture_function, respectively. The new names reflect the purpose of the functions, instead of what they do. The new names also avoid confusion with pytest markers by not using "mark" in their names. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Configuration menu - View commit details
-
Copy full SHA for 7485d70 - Browse repository at this point
Copy the full SHA 7485d70View commit details -
refactor: Removed obsolete elif clause.
Legacy mode has been removed, so we don't need an elif to check if we're in AUTO mode. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Configuration menu - View commit details
-
Copy full SHA for a0b9fd6 - Browse repository at this point
Copy the full SHA a0b9fd6View commit details -
refactor: Renamed the "holder" argument to _preprocess_async_fixtures…
… to "processed_fixturedefs" to better reflect the purpose of the variable. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Configuration menu - View commit details
-
Copy full SHA for 97d5e32 - Browse repository at this point
Copy the full SHA 97d5e32View commit details -
refactor: Simplified branching structure of _preprocess_async_fixtures.
It is safe to call _make_asyncio_fixture_function without checking whether the fixture function has been converted to an asyncio fixture function, because each fixture is only processed once in the loop. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Configuration menu - View commit details
-
Copy full SHA for d9cfe5c - Browse repository at this point
Copy the full SHA d9cfe5cView commit details -
refactor: Simplified logic in _preprocess_async_fixtures.
Merged two if-clauses both of which cause the current fixturedef to be skipped. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Configuration menu - View commit details
-
Copy full SHA for e49a093 - Browse repository at this point
Copy the full SHA e49a093View commit details -
refactor: Extracted _inject_fixture_argnames from _preprocess_async_f…
…ixtures in order to improve readability. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Configuration menu - View commit details
-
Copy full SHA for f539b7e - Browse repository at this point
Copy the full SHA f539b7eView commit details -
refactor: Extracted _synchronize_async_fixture from _preprocess_async…
…_fixtures in order to improve readability. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Configuration menu - View commit details
-
Copy full SHA for 0a30818 - Browse repository at this point
Copy the full SHA 0a30818View commit details