Skip to content

--doctest-modules runs __main__ files #7124

@max-sixty

Description

@max-sixty
  • a detailed description of the bug or suggestion
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions: pytest 5.4.1, MacOS
  • minimal example if possible

As per this SO question, pytest will run __main__.py files when passed --doctest-modules, even though it avoids them when collecting tests without that flag.

Is that intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: doctestsrelated to the doctests builtin plugintopic: collectionrelated to the collection phasetype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions