Skip to content

Commit d909dcc

Browse files
authored
Merge pull request #642 from adamchainz/upgrade_pre_commit
2 parents 1637dc1 + f02aa70 commit d909dcc

File tree

6 files changed

+51
-35
lines changed

6 files changed

+51
-35
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
repos:
22
- repo: https://github.com/ambv/black
3-
rev: 19.10b0
3+
rev: 20.8b1
44
hooks:
55
- id: black
66
args: [--safe, --quiet, --target-version, py35]
77
language_version: python3.7
88
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v2.4.0
9+
rev: v3.4.0
1010
hooks:
1111
- id: trailing-whitespace
1212
- id: end-of-file-fixer
1313
- id: check-yaml
1414
- id: debug-statements
15+
- repo: https://gitlab.com/pycqa/flake8
16+
rev: 3.9.0
17+
hooks:
1518
- id: flake8
1619
- repo: https://github.com/asottile/pyupgrade
17-
rev: v2.7.2
20+
rev: v2.10.1
1821
hooks:
1922
- id: pyupgrade
2023
args: [--py3-plus]

src/xdist/newhooks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def pytest_testnodedown(node, error):
4848

4949

5050
def pytest_xdist_node_collection_finished(node, ids):
51-
"""called by the controller node when a worker node finishes collecting.
52-
"""
51+
"""called by the controller node when a worker node finishes collecting."""
5352

5453

5554
@pytest.mark.firstresult

src/xdist/workermanage.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ def finished():
157157

158158

159159
class HostRSync(execnet.RSync):
160-
""" RSyncer that filters out common files
161-
"""
160+
"""RSyncer that filters out common files"""
162161

163162
def __init__(self, sourcedir, *args, **kwargs):
164163
self._synced = {}
@@ -303,12 +302,12 @@ def notify_inproc(self, eventname, **kwargs):
303302
self.putevent((eventname, kwargs))
304303

305304
def process_from_remote(self, eventcall): # noqa too complex
306-
""" this gets called for each object we receive from
307-
the other side and if the channel closes.
305+
"""this gets called for each object we receive from
306+
the other side and if the channel closes.
308307
309-
Note that channel callbacks run in the receiver
310-
thread of execnet gateways - we need to
311-
avoid raising exceptions or doing heavy work.
308+
Note that channel callbacks run in the receiver
309+
thread of execnet gateways - we need to
310+
avoid raising exceptions or doing heavy work.
312311
"""
313312
try:
314313
if eventcall == self.ENDMARK:

testing/acceptance_test.py

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,7 @@ def test_foo(x):
718718

719719

720720
def test_tmpdir_disabled(testdir):
721-
"""Test xdist doesn't break if internal tmpdir plugin is disabled (#22).
722-
"""
721+
"""Test xdist doesn't break if internal tmpdir plugin is disabled (#22)."""
723722
p1 = testdir.makepyfile(
724723
"""
725724
def test_ok():
@@ -733,8 +732,7 @@ def test_ok():
733732

734733
@pytest.mark.parametrize("plugin", ["xdist.looponfail", "xdist.boxed"])
735734
def test_sub_plugins_disabled(testdir, plugin):
736-
"""Test that xdist doesn't break if we disable any of its sub-plugins. (#32)
737-
"""
735+
"""Test that xdist doesn't break if we disable any of its sub-plugins. (#32)"""
738736
p1 = testdir.makepyfile(
739737
"""
740738
def test_ok():
@@ -1239,14 +1237,22 @@ def test(self, i):
12391237
"test_b.py::TestB", result.outlines
12401238
)
12411239

1242-
assert test_a_workers_and_test_count in (
1243-
{"gw0": 10},
1244-
{"gw1": 0},
1245-
) or test_a_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
1246-
assert test_b_workers_and_test_count in (
1247-
{"gw0": 10},
1248-
{"gw1": 0},
1249-
) or test_b_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
1240+
assert (
1241+
test_a_workers_and_test_count
1242+
in (
1243+
{"gw0": 10},
1244+
{"gw1": 0},
1245+
)
1246+
or test_a_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
1247+
)
1248+
assert (
1249+
test_b_workers_and_test_count
1250+
in (
1251+
{"gw0": 10},
1252+
{"gw1": 0},
1253+
)
1254+
or test_b_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
1255+
)
12501256

12511257
def test_by_class(self, testdir):
12521258
testdir.makepyfile(
@@ -1271,14 +1277,22 @@ def test(self, i):
12711277
"test_a.py::TestB", result.outlines
12721278
)
12731279

1274-
assert test_a_workers_and_test_count in (
1275-
{"gw0": 10},
1276-
{"gw1": 0},
1277-
) or test_a_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
1278-
assert test_b_workers_and_test_count in (
1279-
{"gw0": 10},
1280-
{"gw1": 0},
1281-
) or test_b_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
1280+
assert (
1281+
test_a_workers_and_test_count
1282+
in (
1283+
{"gw0": 10},
1284+
{"gw1": 0},
1285+
)
1286+
or test_a_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
1287+
)
1288+
assert (
1289+
test_b_workers_and_test_count
1290+
in (
1291+
{"gw0": 10},
1292+
{"gw1": 0},
1293+
)
1294+
or test_b_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
1295+
)
12821296

12831297
def test_module_single_start(self, testdir):
12841298
"""Fix test suite never finishing in case all workers start with a single test (#277)."""

testing/test_newhooks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ def pytest_runtest_logreport(report):
4646
)
4747

4848
def test_node_collection_finished(self, testdir):
49-
"""Test pytest_xdist_node_collection_finished hook (#8).
50-
"""
49+
"""Test pytest_xdist_node_collection_finished hook (#8)."""
5150
testdir.makeconftest(
5251
"""
5352
def pytest_xdist_node_collection_finished(node, ids):

testing/test_remote.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def __init__(self, request, testdir):
3737
self.testdir = testdir
3838
self.events = Queue()
3939

40-
def setup(self,):
40+
def setup(
41+
self,
42+
):
4143
self.testdir.chdir()
4244
# import os ; os.environ['EXECNET_DEBUG'] = "2"
4345
self.gateway = execnet.makegateway()

0 commit comments

Comments
 (0)