pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Disable assertion rewriting of external modules for `python_files = *.py`

Open lucascolley opened this issue 7 months ago • 1 comments

https://github.com/pytest-dev/pytest/issues/10845#issuecomment-2802869441

i think that part deserves a new issue that specifically handles that part

cc @RonnyPfannschmidt @The-Compiler

lucascolley avatar Apr 30 '25 18:04 lucascolley

For context, from https://github.com/pytest-dev/pytest/issues/10845#issuecomment-2577509473:

  • pytest does assertion rewriting for everything (even third-party modules outside of the test rootdir) if python_files = *.py is set. IMHO that is a pytest bug, though I never really was deeply involved with the assertion rewriting code, so I'd love to hear what other maintainers think.

The-Compiler avatar May 02 '25 16:05 The-Compiler