From 54a954514b5a02b4858707ef653a1a204cd05509 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 16 Nov 2019 18:53:29 +0100 Subject: [PATCH] re-run black --- src/_pytest/config/argparsing.py | 2 +- src/_pytest/pytester.py | 2 +- testing/python/fixtures.py | 6 +++--- testing/python/raises.py | 2 +- testing/test_collection.py | 8 ++++---- testing/test_mark.py | 2 +- testing/test_skipping.py | 2 +- testing/test_tmpdir.py | 2 +- testing/test_unittest.py | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 4eec6be05..7cbb676bd 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -395,7 +395,7 @@ class MyOptionParser(argparse.ArgumentParser): options = ", ".join(option for _, option, _ in option_tuples) self.error(msg % {"option": arg_string, "matches": options}) elif len(option_tuples) == 1: - option_tuple, = option_tuples + (option_tuple,) = option_tuples return option_tuple if self._negative_number_matcher.match(arg_string): if not self._has_negative_number_optionals: diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index ca780a9f5..02414a299 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -312,7 +312,7 @@ class HookRecorder: return self.getfailures("pytest_collectreport") def listoutcomes( - self + self, ) -> Tuple[List[TestReport], List[TestReport], List[TestReport]]: passed = [] skipped = [] diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index 6dca793e0..52fd32cc4 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -503,7 +503,7 @@ class TestRequestBasic: assert repr(req).find(req.function.__name__) != -1 def test_request_attributes_method(self, testdir): - item, = testdir.getitems( + (item,) = testdir.getitems( """ import pytest class TestB(object): @@ -531,7 +531,7 @@ class TestRequestBasic: pass """ ) - item1, = testdir.genitems([modcol]) + (item1,) = testdir.genitems([modcol]) assert item1.name == "test_method" arg2fixturedefs = fixtures.FixtureRequest(item1)._arg2fixturedefs assert len(arg2fixturedefs) == 1 @@ -781,7 +781,7 @@ class TestRequestBasic: def test_request_getmodulepath(self, testdir): modcol = testdir.getmodulecol("def test_somefunc(): pass") - item, = testdir.genitems([modcol]) + (item,) = testdir.genitems([modcol]) req = fixtures.FixtureRequest(item) assert req.fspath == modcol.fspath diff --git a/testing/python/raises.py b/testing/python/raises.py index 28b0715c0..1c701796a 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -205,7 +205,7 @@ class TestRaises: with pytest.raises(AssertionError) as excinfo: with pytest.raises(AssertionError, match="'foo"): raise AssertionError("'bar") - msg, = excinfo.value.args + (msg,) = excinfo.value.args assert msg == 'Pattern "\'foo" not found in "\'bar"' def test_raises_match_wrong_type(self): diff --git a/testing/test_collection.py b/testing/test_collection.py index f18d36d24..e4a70b1a7 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -486,7 +486,7 @@ class TestSession: p = testdir.makepyfile("def test_func(): pass") id = "::".join([p.basename, "test_func"]) items, hookrec = testdir.inline_genitems(id) - item, = items + (item,) = items assert item.name == "test_func" newid = item.nodeid assert newid == id @@ -605,9 +605,9 @@ class TestSession: testdir.makepyfile("def test_func(): pass") items, hookrec = testdir.inline_genitems() assert len(items) == 1 - item, = items + (item,) = items items2, hookrec = testdir.inline_genitems(item.nodeid) - item2, = items2 + (item2,) = items2 assert item2.name == item.name assert item2.fspath == item.fspath @@ -622,7 +622,7 @@ class TestSession: arg = p.basename + "::TestClass::test_method" items, hookrec = testdir.inline_genitems(arg) assert len(items) == 1 - item, = items + (item,) = items assert item.nodeid.endswith("TestClass::test_method") # ensure we are reporting the collection of the single test item (#2464) assert [x.name for x in self.get_reported_items(hookrec)] == ["test_method"] diff --git a/testing/test_mark.py b/testing/test_mark.py index ba7599804..0e4422025 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1011,7 +1011,7 @@ def test_markers_from_parametrize(testdir): def test_pytest_param_id_requires_string(): with pytest.raises(TypeError) as excinfo: pytest.param(id=True) - msg, = excinfo.value.args + (msg,) = excinfo.value.args assert msg == "Expected id to be a string, got : True" diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 86f328a93..67714d030 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -115,7 +115,7 @@ class TestEvaluator: ) def test_skipif_class(self, testdir): - item, = testdir.getitems( + (item,) = testdir.getitems( """ import pytest class TestClass(object): diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index 29b6db947..eb1c1f300 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -258,7 +258,7 @@ class TestNumberedDir: registry = [] register_cleanup_lock_removal(lock, register=registry.append) - cleanup_func, = registry + (cleanup_func,) = registry assert lock.is_file() diff --git a/testing/test_unittest.py b/testing/test_unittest.py index f56284d85..885178402 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -383,7 +383,7 @@ def test_testcase_custom_exception_info(testdir, type): def test_testcase_totally_incompatible_exception_info(testdir): - item, = testdir.getitems( + (item,) = testdir.getitems( """ from unittest import TestCase class MyTestCase(TestCase):