Skip to content

Documentation inconsistency: should pytest_addoption be implemented in conftest.py? #1427

Closed
@philandstuff

Description

@philandstuff

The latest docs for parameterized tests give an example of implementing pytest_addoption in conftest.py.

But the docs for pytest_addoption itself say:

Implementing this hook from conftest.py files is strongly discouraged because conftest.py files are lazily loaded and may give strange unknown option errors depending on the directory py.test is invoked from.

I am confused because I have just followed the example in the latest parameterized test docs, only to discover I'm doing something that seems to be strongly discouraged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions