pytest: UsageError in package that contains pytest_plugins module
When running pytest --doctest-modules
on a package that contains a pytest plugin, pytest
errors out and produces a pretty long stacktrace. The code that triggers the error is the _get_plugin_specs_as_list
function that receives a module object instead of a list or a string.
The behavior is OS-independent as far as I can tell, but affects only pytest 3.7+ ; pytest 3.6.4 works fine. Also note that the error is only triggered when doc-testing the specific subpackage that contains the plugin.
For proper context, we have the following directory structure:
odl
|
|- util --
| |- pytest_plugins.py
| |- ...
| - ...
The error is triggered by pytest --doctest-modules odl/util
.
The full backtrace is here. Link to the subpackage: https://github.com/odlgroup/odl/tree/master/odl/util
Edit: Updated pytest versions affected
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- TST: rename pytest_plugins -> pytest_config The name `pytest_plugins` is an internally used reserved name that our package messes up, see https://github.com/pytest-dev/pytest/issues/3899 — committed to kohr-h/odl by kohr-h 5 years ago
- TST: rename pytest_plugins -> pytest_config The name `pytest_plugins` is an internally used reserved name that our package messes up, see https://github.com/pytest-dev/pytest/issues/3899 — committed to kohr-h/odl by kohr-h 5 years ago
- TST: rename pytest_plugins -> pytest_config The name `pytest_plugins` is an internally used reserved name that our package messes up, see https://github.com/pytest-dev/pytest/issues/3899 — committed to kohr-h/odl by kohr-h 5 years ago
- Do not raise UsageError when "pytest_plugins" is a module Fix #3899 — committed to nicoddemus/pytest by nicoddemus 5 years ago
- Do not raise UsageError when "pytest_plugins" is a module Fix #3899 — committed to nicoddemus/pytest by nicoddemus 5 years ago
- Do not raise UsageError when "pytest_plugins" is a module Fix #3899 — committed to nicoddemus/pytest by nicoddemus 5 years ago
- Do not raise UsageError when "pytest_plugins" is a module Fix #3899 — committed to nicoddemus/pytest by nicoddemus 5 years ago
- Update pytest to 4.2.1 This PR updates [pytest](https://pypi.org/project/pytest) from **4.2.0** to **4.2.1**. <details> <summary>Changelog</summary> ### 4.2.1 ``` ===============... — committed to mozilla-services/tecken by pyup-bot 5 years ago
- Merge #61 61: Update pytest to 4.3.0 r=rehandalal a=pyup-bot This PR updates [pytest](https://pypi.org/project/pytest) from **4.2.0** to **4.3.0**. <details> <summary>Changelog</summary> ... — committed to rehandalal/therapist by bors[bot] 5 years ago
- Merge #1743 #1744 1743: Update dependency webpack to v4.29.5 r=mythmon a=renovate[bot] This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---... — committed to mozilla/normandy by bors[bot] 5 years ago
- Merge #32 32: Pin pytest to latest version 5.1.3 r=duckinator a=pyup-bot This PR pins [pytest](https://pypi.org/project/pytest) to the latest release **5.1.3**. <details> <summary>Changelog</s... — committed to duckinator/bork by bors[bot] 5 years ago
- Merge #1 1: Initial Update r=aragilar a=pyup-bot This PR sets up pyup.io on this repo and updates all dependencies at once, in a single branch. Subsequent pull requests will update one dependency... — committed to aragilar/pytest-info-collector by bors[bot] 4 years ago
- Merge #1 1: Initial Update r=aragilar a=pyup-bot This PR sets up pyup.io on this repo and updates all dependencies at once, in a single branch. Subsequent pull requests will update one dependency... — committed to aragilar/spaceplot by bors[bot] 4 years ago
- Merge #1 1: Initial Update r=aragilar a=pyup-bot This PR sets up pyup.io on this repo and updates all dependencies at once, in a single branch. Subsequent pull requests will update one dependency... — committed to aragilar/venv_tools by bors[bot] 4 years ago
- Merge #5 5: Initial Update r=aragilar a=pyup-bot This PR sets up pyup.io on this repo and updates all dependencies at once, in a single branch. Subsequent pull requests will update one dependency... — committed to aragilar/root-solver by bors[bot] 4 years ago
@nicoddemus @RonnyPfannschmidt @blueyed Thanks for looking into this. I think the issue sits deep and one has to be somewhat unlucky to hit it. So we’ll just change the name of the module. I can confirm that giving it some other name solves the problem.
The documentation on plugins doesn’t mention the case discussed here. If you think it’s worth giving it a brief mention, I can add a sentence to the docs.
We should probably issue a warning instead, instead of ignoring it.