Upgrade pre-commit hooks

Use `pre-commit autoupdate` to upgrade, and follow the message from `pre-commit-hooks` to move to the official `flake8` hook.
This commit is contained in:
Adam Johnson
2021-03-19 15:09:49 +00:00
committed by Bruno Oliveira
parent 1637dc18d0
commit f02aa70c95
6 changed files with 51 additions and 35 deletions

View File

@@ -718,8 +718,7 @@ def test_issue_594_random_parametrize(testdir):
def test_tmpdir_disabled(testdir):
"""Test xdist doesn't break if internal tmpdir plugin is disabled (#22).
"""
"""Test xdist doesn't break if internal tmpdir plugin is disabled (#22)."""
p1 = testdir.makepyfile(
"""
def test_ok():
@@ -733,8 +732,7 @@ def test_tmpdir_disabled(testdir):
@pytest.mark.parametrize("plugin", ["xdist.looponfail", "xdist.boxed"])
def test_sub_plugins_disabled(testdir, plugin):
"""Test that xdist doesn't break if we disable any of its sub-plugins. (#32)
"""
"""Test that xdist doesn't break if we disable any of its sub-plugins. (#32)"""
p1 = testdir.makepyfile(
"""
def test_ok():
@@ -1239,14 +1237,22 @@ class TestFileScope:
"test_b.py::TestB", result.outlines
)
assert test_a_workers_and_test_count in (
{"gw0": 10},
{"gw1": 0},
) or test_a_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
assert test_b_workers_and_test_count in (
{"gw0": 10},
{"gw1": 0},
) or test_b_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
assert (
test_a_workers_and_test_count
in (
{"gw0": 10},
{"gw1": 0},
)
or test_a_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
)
assert (
test_b_workers_and_test_count
in (
{"gw0": 10},
{"gw1": 0},
)
or test_b_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
)
def test_by_class(self, testdir):
testdir.makepyfile(
@@ -1271,14 +1277,22 @@ class TestFileScope:
"test_a.py::TestB", result.outlines
)
assert test_a_workers_and_test_count in (
{"gw0": 10},
{"gw1": 0},
) or test_a_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
assert test_b_workers_and_test_count in (
{"gw0": 10},
{"gw1": 0},
) or test_b_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
assert (
test_a_workers_and_test_count
in (
{"gw0": 10},
{"gw1": 0},
)
or test_a_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
)
assert (
test_b_workers_and_test_count
in (
{"gw0": 10},
{"gw1": 0},
)
or test_b_workers_and_test_count in ({"gw0": 0}, {"gw1": 10})
)
def test_module_single_start(self, testdir):
"""Fix test suite never finishing in case all workers start with a single test (#277)."""

View File

@@ -46,8 +46,7 @@ class TestHooks:
)
def test_node_collection_finished(self, testdir):
"""Test pytest_xdist_node_collection_finished hook (#8).
"""
"""Test pytest_xdist_node_collection_finished hook (#8)."""
testdir.makeconftest(
"""
def pytest_xdist_node_collection_finished(node, ids):

View File

@@ -37,7 +37,9 @@ class WorkerSetup:
self.testdir = testdir
self.events = Queue()
def setup(self,):
def setup(
self,
):
self.testdir.chdir()
# import os ; os.environ['EXECNET_DEBUG'] = "2"
self.gateway = execnet.makegateway()