Skip to content
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

List of disabled plugins is not passed down to runpytest() #12186

Open
mtelka opened this issue Apr 4, 2024 · 0 comments
Open

List of disabled plugins is not passed down to runpytest() #12186

mtelka opened this issue Apr 4, 2024 · 0 comments

Comments

@mtelka
Copy link

mtelka commented Apr 4, 2024

When there are some pytest plugins disabled using the -p no:XXX option the information about disabled plugins is not passed down to the runpytest() call, so the initially disabled plugin appears as enabled there.

Simple test to show the issue:

$ wget https://files.pythonhosted.org/packages/source/p/pytest_metadata/pytest_metadata-3.1.1.tar.gz
$ tar xf pytest_metadata-3.1.1.tar.gz
$ cd pytest_metadata-3.1.1/
$ sed -i -e '/\[testenv\]/a\'$'\n''deps = pytest-checkdocs' tox.ini
$ sed -i -e 's/setenv =/& PYTEST_ADDOPTS="-p no:checkdocs"/' tox.ini
$ tox -e py39
py39: install_deps> python -I -m pip install pytest-checkdocs
.pkg: install_requires> python -I -m pip install 'hatch-vcs>=0.3' 'hatchling>=1.13'
.pkg: _optional_hooks> python /usr/lib/python3.9/vendor-packages/pyproject_api/_backend.py True hatchling.build
.pkg: get_requires_for_build_sdist> python /usr/lib/python3.9/vendor-packages/pyproject_api/_backend.py True hatchling.build
.pkg: build_sdist> python /usr/lib/python3.9/vendor-packages/pyproject_api/_backend.py True hatchling.build
py39: install_package_deps> python -I -m pip install 'pytest>=7.0.0'
py39: install_package> python -I -m pip install --force-reinstall --no-deps /tmp/pytest_metadata-3.1.1/.tox/.tmp/package/1/pytest_metadata-3.1.1.tar.gz
py39: commands[0]> pytest -s -ra --color=yes
============================= test session starts ==============================
platform sunos5 -- Python 3.9.19, pytest-8.1.1, pluggy-1.4.0
cachedir: .tox/py39/.pytest_cache
rootdir: /tmp/pytest_metadata-3.1.1
configfile: tox.ini
testpaths: tests
plugins: metadata-3.1.1
collected 10 items

tests/test_metadata.py ============================= test session starts ==============================
platform sunos5 -- Python 3.9.19, pytest-8.1.1, pluggy-1.4.0
rootdir: /tmp/pytest-of-marcel/pytest-2/test_metadata0
plugins: checkdocs-2.12.0, metadata-3.1.1
collected 1 item

test_metadata.py .                                                       [100%]

============================== 1 passed in 0.02s ===============================

... [snip] ...

Please note the plugins: checkdocs-2.12.0, metadata-3.1.1 line above. I expect to do not see checkdocs-2.12.0 there.

Related issue: #12073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant