Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Root conftest for pytest.

``pytest_addoption`` must live in the *rootdir* conftest (or a plugin):
since pytest 9.0 the hook is no longer picked up from a subdirectory
conftest (e.g. ``tests/conftest.py``) reached only via ``testpaths``,
which caused "unrecognized arguments: --wiki_domain ..." in CI. The
option-backed fixtures stay in ``tests/conftest.py``.
"""


def pytest_addoption(parser):
parser.addoption("--wiki_domain", action="store")
parser.addoption("--wiki_username", action="store")
parser.addoption("--wiki_password", action="store")
parser.addoption("--db_username", action="store")
parser.addoption("--db_password", action="store")
10 changes: 3 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@

import pytest


def pytest_addoption(parser):
parser.addoption("--wiki_domain", action="store")
parser.addoption("--wiki_username", action="store")
parser.addoption("--wiki_password", action="store")
parser.addoption("--db_username", action="store")
parser.addoption("--db_password", action="store")
# Note: pytest_addoption lives in the repo-root conftest.py - since pytest 9.0
# it is not loaded from this subdirectory conftest via testpaths. The
# option-backed fixtures below stay here.


@pytest.fixture(scope="session")
Expand Down
Loading