diff --git a/_pytest/main.py b/_pytest/main.py index 063c71660..845d5dd00 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -44,11 +44,6 @@ def pytest_addoption(parser): help="run pytest in strict mode, warnings become errors.") group._addoption("-c", metavar="file", type=str, dest="inifilename", help="load configuration from `file` instead of trying to locate one of the implicit configuration files.") - group.addoption('--setuponly', '--setup-only', action="store_true", - help="only setup fixtures, don't execute the tests.") - group.addoption('--setupplan', '--setup-plan', action="store_true", - help="show what fixtures and tests would be executed but don't" - " execute anything.") group._addoption("--continue-on-collection-errors", action="store_true", default=False, dest="continue_on_collection_errors", help="Force test execution even if collection errors occur.") diff --git a/_pytest/setuponly.py b/_pytest/setuponly.py index 98830c76b..abb578da7 100644 --- a/_pytest/setuponly.py +++ b/_pytest/setuponly.py @@ -1,6 +1,11 @@ import pytest import sys +def pytest_addoption(parser): + group = parser.getgroup("debugconfig") + group.addoption('--setuponly', '--setup-only', action="store_true", + help="only setup fixtures, don't execute the tests.") + @pytest.hookimpl(hookwrapper=True) def pytest_fixture_setup(fixturedef, request): yield diff --git a/_pytest/setupplan.py b/_pytest/setupplan.py index 65df65d18..c7c8ff60d 100644 --- a/_pytest/setupplan.py +++ b/_pytest/setupplan.py @@ -1,5 +1,10 @@ import pytest +def pytest_addoption(parser): + group = parser.getgroup("debugconfig") + group.addoption('--setupplan', '--setup-plan', action="store_true", + help="show what fixtures and tests would be executed but don't" + " execute anything.") @pytest.hookimpl(tryfirst=True) def pytest_fixture_setup(fixturedef, request):