Skip to content

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

@lucascolley

Description

@lucascolley

#10845 (comment)

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

cc @RonnyPfannschmidt @The-Compiler

Activity

The-Compiler

The-Compiler commented on May 2, 2025

@The-Compiler
Member

For context, from #10845 (comment):

  • 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.
added
type: bugproblem that needs to be addressed
topic: rewriterelated to the assertion rewrite mechanism
on May 2, 2025
linked a pull request that will close this issue on May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: collectionrelated to the collection phasetopic: rewriterelated to the assertion rewrite mechanismtype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @The-Compiler@lucascolley

      Issue actions

        Disable assertion rewriting of external modules for `python_files = *.py` · Issue #13403 · pytest-dev/pytest