Move setupplan and setuponly options to their respective modules.
Also, changed their group from "general" to "debugconfig".
This commit is contained in:
		
							parent
							
								
									032ce8baf6
								
							
						
					
					
						commit
						da5c579d82
					
				|  | @ -44,11 +44,6 @@ def pytest_addoption(parser): | ||||||
|                help="run pytest in strict mode, warnings become errors.") |                help="run pytest in strict mode, warnings become errors.") | ||||||
|     group._addoption("-c", metavar="file", type=str, dest="inifilename", |     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.") |                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", |     group._addoption("--continue-on-collection-errors", action="store_true", | ||||||
|                default=False, dest="continue_on_collection_errors", |                default=False, dest="continue_on_collection_errors", | ||||||
|                help="Force test execution even if collection errors occur.") |                help="Force test execution even if collection errors occur.") | ||||||
|  |  | ||||||
|  | @ -1,6 +1,11 @@ | ||||||
| import pytest | import pytest | ||||||
| import sys | 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) | @pytest.hookimpl(hookwrapper=True) | ||||||
| def pytest_fixture_setup(fixturedef, request): | def pytest_fixture_setup(fixturedef, request): | ||||||
|     yield |     yield | ||||||
|  |  | ||||||
|  | @ -1,5 +1,10 @@ | ||||||
| import pytest | 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) | @pytest.hookimpl(tryfirst=True) | ||||||
| def pytest_fixture_setup(fixturedef, request): | def pytest_fixture_setup(fixturedef, request): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue