-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
topic: configrelated to config handling, argument parsing and config filerelated to config handling, argument parsing and config file
Description
With a pytest.ini like
[pytest]
required_plugins = pytest-qt pytest-bdd
when those plugins are installed from VCS, pytest doesn't seem to detect pytest-qt
(and some others), while pytest-bdd
(and some others) are fine.
To reproduce:
$ python3 -m venv .venv
$ .venv/bin/pip install -qU pip setuptools wheel
$ .venv/bin/pip install pytest git+https://github.com/pytest-dev/pytest-qt.git git+https://github.com/pytest-dev/pytest-bdd.git
[...]
Successfully installed [...] packaging-20.9 parse-1.19.0 [...] pluggy-0.13.1 py-1.10.0 [...] pytest-6.2.2 pytest-bdd-4.0.2 pytest-qt-3.3.1.dev71+g1fbdd94 [...]
$ cat > pytest.ini
[pytest]
required_plugins = pytest-qt pytest-bdd
$ ./.venv/bin/pytest
ERROR: Missing required plugins: pytest-qt
$ .venv/bin/pip freeze
[...]
pytest-bdd @ git+https://github.com/pytest-dev/pytest-bdd.git@5d58fe3bbbf38d2408701f4876281a3440890522
pytest-qt @ git+https://github.com/pytest-dev/pytest-qt.git@1fbdd944d33c49662894661b4071fb641a681b21
[...]
Looking at it with a debugger, apparently this condition:
pytest/src/_pytest/config/__init__.py
Line 1280 in dd37097
elif Version(plugin_dist_info[spec.name]) not in spec.specifier: |
works fine for pytest-bdd:
> .../_pytest/config/__init__.py(1273)_validate_plugins()
-> try:
(Pdb) required_plugin
'pytest-bdd'
(Pdb) n
> .../_pytest/config/__init__.py(1281)_validate_plugins()
-> elif Version(plugin_dist_info[spec.name]) not in spec.specifier:
(Pdb) plugin_dist_info[spec.name]
'4.0.2'
(Pdb) spec.specifier
<SpecifierSet('')>
(Pdb) plugin_dist_info[spec.name] in spec.specifier
True
but not pytest-qt:
(Pdb) required_plugin
'pytest-qt'
(Pdb) n
> .../_pytest/config/__init__.py(1281)_validate_plugins()
-> elif Version(plugin_dist_info[spec.name]) not in spec.specifier:
(Pdb) plugin_dist_info[spec.name]
'3.3.1.dev71+g1fbdd94'
(Pdb) spec.specifier
<SpecifierSet('')>
(Pdb) plugin_dist_info[spec.name] in spec.specifier
False
(Pdb) n
> /home/florian/proj/pytest/src/_pytest/config/__init__.py(1282)_validate_plugins()
-> missing_plugins.append(required_plugin)
I'm not sure why that is - I suspect setuptools-scm comes into play somehow?
Metadata
Metadata
Assignees
Labels
topic: configrelated to config handling, argument parsing and config filerelated to config handling, argument parsing and config file