Skip to content

Don't assume doctestmodules exists on Namespace #270

@Carreau

Description

@Carreau

When a plugin is installed; it get called even on projects that don't use it.

In particular on some projects I get:

INTERNALERROR>   File "/Users/bussonniermatthias/miniconda3/envs/arm64/lib/python3.12/site-packages/pytest_doctestplus/plugin.py", line 212, in pytest_configure
INTERNALERROR>     run_regular_doctest = config.option.doctestmodules and not config.option.doctest_plus
INTERNALERROR>                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> AttributeError: 'Namespace' object has no attribute 'doctestmodules'

Could we get a conditional check it exists ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions