Skip to content

Commit 79752cb

Browse files
committed
fmt with black
1 parent 784dc7f commit 79752cb

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

conftest.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def pytest_unconfigure(config):
3737
# https://github.com/AdamGleave/pytest-shard/blob/64610a08dac6b0511b6d51cf895d0e1040d162ad/pytest_shard/pytest_shard.py
3838

3939

40-
def get_group(items: Iterable[nodes.Node], group_count: int, group_id: int) -> Sequence[nodes.Node]:
40+
def get_group(
41+
items: Iterable[nodes.Node], group_count: int, group_id: int
42+
) -> Sequence[nodes.Node]:
4143
"""Get the items from the passed in group based on group count."""
4244
if not (0 <= group_id < group_count):
4345
raise ValueError("Invalid test-group argument")
@@ -53,29 +55,34 @@ def get_group_id(node: nodes.Node) -> int:
5355

5456

5557
def pytest_addoption(parser):
56-
group = parser.getgroup('split your tests into evenly sized groups and run them')
57-
group.addoption('--test-group-count', dest='test-group-count', type=int,
58-
help='The number of groups to split the tests into')
59-
group.addoption('--test-group', dest='test-group', type=int,
60-
help='The group of tests that should be executed')
58+
group = parser.getgroup("split your tests into evenly sized groups and run them")
59+
group.addoption(
60+
"--test-group-count",
61+
dest="test-group-count",
62+
type=int,
63+
help="The number of groups to split the tests into",
64+
)
65+
group.addoption(
66+
"--test-group",
67+
dest="test-group",
68+
type=int,
69+
help="The group of tests that should be executed",
70+
)
6171

6272

6373
def pytest_collection_modifyitems(session, config, items: List[nodes.Node]):
64-
group_count = config.getoption('test-group-count')
65-
group_id = config.getoption('test-group')
74+
group_count = config.getoption("test-group-count")
75+
group_id = config.getoption("test-group")
6676

6777
if not group_count or not group_id:
6878
return
6979

7080
items[:] = get_group(items, group_count, group_id)
7181

72-
terminal_reporter = config.pluginmanager.get_plugin('terminalreporter')
82+
terminal_reporter = config.pluginmanager.get_plugin("terminalreporter")
7383
terminal_writer = create_terminal_writer(config)
7484
message = terminal_writer.markup(
75-
'Running test group #{0} ({1} tests)\n'.format(
76-
group_id,
77-
len(items)
78-
),
79-
yellow=True
85+
"Running test group #{0} ({1} tests)\n".format(group_id, len(items)),
86+
yellow=True,
8087
)
8188
terminal_reporter.write(message)

0 commit comments

Comments
 (0)