Skip to content

Pytest doen't rewrite conftes plugins #13517

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

Open
4 tasks done
Tusenka opened this issue Jun 15, 2025 · 0 comments
Open
4 tasks done

Pytest doen't rewrite conftes plugins #13517

Tusenka opened this issue Jun 15, 2025 · 0 comments

Comments

@Tusenka
Copy link

Tusenka commented Jun 15, 2025

As per discussed:

I try to run pytest rewriting for custom plugins. However it doesn't load a conftest plugin at the rewrting stage.

Example:

https://github.com/Tusenka/pytest/tree/disable_assertion_rewriting_external_modules/testing/example_scripts/rewrite

Expected result:

It sees the conftest plugin "some_plugin "for rewritng.

Result:

It doesn't see conftest plugins:
image
Result of provided plugins:
['pytest', 'zope.interface', 'idna', 'anyio', 'sniffio', 'filelock', 'cachetools', 'incremental', 'greenlet', 'pluggy', 'hypothesis', 'Automat', 'wheel', 'virtualenv', 'coverage', 'pip', 'distlib', 'mock', 'pre_commit', 'typing_extensions', 'elementpath', 'pytest-twisted', 'PyYAML', 'pyproject-api', 'identify', 'colorama', 'urllib3', 'hyperlink', 'Pygments', 'sortedcontainers', 'constantly', 'nodeenv', 'xmlschema', 'setuptools', 'attrs', 'requests', 'pytest', 'exceptiongroup', 'decorator', 'platformdirs', 'packaging', 'charset-normalizer', 'cfgv', 'Twisted', 'certifi', 'chardet', 'tox', 'argcomplete', 'iniconfig', 'jaraco.collections', 'zipp', 'typeguard', 'wheel', 'importlib_metadata', 'jaraco.text', 'jaraco.context', 'autocommand', 'tomli', 'typing_extensions', 'more-itertools', 'jaraco.functools', 'packaging', 'platformdirs', 'inflect', 'backports.tarfile']

`

def _mark_plugins_for_rewrite(

Pip info:

anyio 4.9.0
argcomplete 3.6.2
attrs 25.3.0
Automat 25.4.16
cachetools 5.5.2
certifi 2025.4.26
cfgv 3.4.0
chardet 5.2.0
charset-normalizer 3.4.2
colorama 0.4.6
constantly 23.10.4
coverage 7.8.0
decorator 5.2.1
distlib 0.3.9
elementpath 5.0.0
exceptiongroup 1.3.0
filelock 3.18.0
greenlet 3.2.2
hyperlink 21.0.0
hypothesis 6.131.9
identify 2.6.12
idna 3.10
incremental 24.7.2
iniconfig 2.1.0
mock 5.2.0
nodeenv 1.9.1
packaging 25.0
pip 25.0.1
platformdirs 4.3.8
pluggy 1.5.0
pre_commit 4.2.0
Pygments 2.19.1
pyproject-api 1.9.1
pytest 8.5.0.dev32+g1d5a61269.d20250613 /home/cas12/PycharmProjects/pytest-play
pytest-twisted 1.14.3
PyYAML 6.0.2
requests 2.32.3
setuptools 78.1.0
sniffio 1.3.1
sortedcontainers 2.4.0
tox 4.26.0
Twisted 24.11.0
typing_extensions 4.13.2
urllib3 2.4.0
virtualenv 20.31.2
wheel 0.45.1
xmlschema 4.0.1
zope.interface 7.2

Pytest and OS:

Image

  • a detailed description of the bug or problem you are having
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions
  • minimal example if possible
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