Skip to content

Commit 6438895

Browse files
committed
Fix PEP-8.
1 parent b650c3c commit 6438895

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

_pytest/setuponly.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import pytest
22
import sys
33

4+
45
def pytest_addoption(parser):
56
group = parser.getgroup("debugconfig")
67
group.addoption('--setuponly', '--setup-only', action="store_true",
7-
help="only setup fixtures, don't execute the tests.")
8+
help="only setup fixtures, don't execute the tests.")
89
group.addoption('--setupshow', '--setup-show', action="store_true",
9-
help="show setup fixtures while executing the tests.")
10+
help="show setup fixtures while executing the tests.")
11+
1012

1113
@pytest.hookimpl(hookwrapper=True)
1214
def pytest_fixture_setup(fixturedef, request):
@@ -20,11 +22,13 @@ def pytest_fixture_setup(fixturedef, request):
2022
if callable(fixturedef.ids):
2123
fixturedef.cached_param = fixturedef.ids(request.param)
2224
else:
23-
fixturedef.cached_param = fixturedef.ids[request.param_index]
25+
fixturedef.cached_param = fixturedef.ids[
26+
request.param_index]
2427
else:
2528
fixturedef.cached_param = request.param
2629
_show_fixture_action(fixturedef, 'SETUP')
2730

31+
2832
def pytest_fixture_post_finalizer(fixturedef):
2933
if hasattr(fixturedef, "cached_result"):
3034
config = fixturedef._fixturemanager.config
@@ -33,6 +37,7 @@ def pytest_fixture_post_finalizer(fixturedef):
3337
if hasattr(fixturedef, "cached_param"):
3438
del fixturedef.cached_param
3539

40+
3641
def _show_fixture_action(fixturedef, msg):
3742
config = fixturedef._fixturemanager.config
3843
capman = config.pluginmanager.getplugin('capturemanager')
@@ -60,6 +65,7 @@ def _show_fixture_action(fixturedef, msg):
6065
sys.stdout.write(out)
6166
sys.stderr.write(err)
6267

68+
6369
@pytest.hookimpl(tryfirst=True)
6470
def pytest_cmdline_main(config):
6571
if config.option.setuponly:

_pytest/setupplan.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import pytest
22

3+
34
def pytest_addoption(parser):
45
group = parser.getgroup("debugconfig")
56
group.addoption('--setupplan', '--setup-plan', action="store_true",
6-
help="show what fixtures and tests would be executed but don't"
7-
" execute anything.")
7+
help="show what fixtures and tests would be executed but "
8+
"don't execute anything.")
9+
810

911
@pytest.hookimpl(tryfirst=True)
1012
def pytest_fixture_setup(fixturedef, request):
@@ -13,6 +15,7 @@ def pytest_fixture_setup(fixturedef, request):
1315
fixturedef.cached_result = (None, None, None)
1416
return fixturedef.cached_result
1517

18+
1619
@pytest.hookimpl(tryfirst=True)
1720
def pytest_cmdline_main(config):
1821
if config.option.setupplan:

0 commit comments

Comments
 (0)