File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ """Root conftest for pytest.
2+
3+ ``pytest_addoption`` must live in the *rootdir* conftest (or a plugin):
4+ since pytest 9.0 the hook is no longer picked up from a subdirectory
5+ conftest (e.g. ``tests/conftest.py``) reached only via ``testpaths``,
6+ which caused "unrecognized arguments: --wiki_domain ..." in CI. The
7+ option-backed fixtures stay in ``tests/conftest.py``.
8+ """
9+
10+
11+ def pytest_addoption (parser ):
12+ parser .addoption ("--wiki_domain" , action = "store" )
13+ parser .addoption ("--wiki_username" , action = "store" )
14+ parser .addoption ("--wiki_password" , action = "store" )
15+ parser .addoption ("--db_username" , action = "store" )
16+ parser .addoption ("--db_password" , action = "store" )
Original file line number Diff line number Diff line change 99
1010import pytest
1111
12-
13- def pytest_addoption (parser ):
14- parser .addoption ("--wiki_domain" , action = "store" )
15- parser .addoption ("--wiki_username" , action = "store" )
16- parser .addoption ("--wiki_password" , action = "store" )
17- parser .addoption ("--db_username" , action = "store" )
18- parser .addoption ("--db_password" , action = "store" )
12+ # Note: pytest_addoption lives in the repo-root conftest.py - since pytest 9.0
13+ # it is not loaded from this subdirectory conftest via testpaths. The
14+ # option-backed fixtures below stay here.
1915
2016
2117@pytest .fixture (scope = "session" )
You can’t perform that action at this time.
0 commit comments