Skip to content

Commit e379604

Browse files
authored
pre-commit: upgrade black (#6208)
2 parents 4b7148f + 54a9545 commit e379604

File tree

11 files changed

+17
-17
lines changed

11 files changed

+17
-17
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exclude: doc/en/example/py2py3/test_py2.py
22
repos:
33
- repo: https://github.com/psf/black
4-
rev: 19.3b0
4+
rev: 19.10b0
55
hooks:
66
- id: black
77
args: [--safe, --quiet]

src/_pytest/config/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ def directory_arg(path, optname):
131131

132132

133133
# Plugins that cannot be disabled via "-p no:X" currently.
134-
essential_plugins = ( # fmt: off
134+
essential_plugins = (
135135
"mark",
136136
"main",
137137
"runner",
138138
"fixtures",
139139
"helpconfig", # Provides -p.
140-
) # fmt: on
140+
)
141141

142142
default_plugins = essential_plugins + (
143143
"python",

src/_pytest/config/argparsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def _parse_optional(self, arg_string):
395395
options = ", ".join(option for _, option, _ in option_tuples)
396396
self.error(msg % {"option": arg_string, "matches": options})
397397
elif len(option_tuples) == 1:
398-
option_tuple, = option_tuples
398+
(option_tuple,) = option_tuples
399399
return option_tuple
400400
if self._negative_number_matcher.match(arg_string):
401401
if not self._has_negative_number_optionals:

src/_pytest/pytester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def getfailedcollections(self) -> List[TestReport]:
312312
return self.getfailures("pytest_collectreport")
313313

314314
def listoutcomes(
315-
self
315+
self,
316316
) -> Tuple[List[TestReport], List[TestReport], List[TestReport]]:
317317
passed = []
318318
skipped = []

testing/python/fixtures.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def test_func(something): pass
503503
assert repr(req).find(req.function.__name__) != -1
504504

505505
def test_request_attributes_method(self, testdir):
506-
item, = testdir.getitems(
506+
(item,) = testdir.getitems(
507507
"""
508508
import pytest
509509
class TestB(object):
@@ -531,7 +531,7 @@ def test_method(self, something):
531531
pass
532532
"""
533533
)
534-
item1, = testdir.genitems([modcol])
534+
(item1,) = testdir.genitems([modcol])
535535
assert item1.name == "test_method"
536536
arg2fixturedefs = fixtures.FixtureRequest(item1)._arg2fixturedefs
537537
assert len(arg2fixturedefs) == 1
@@ -781,7 +781,7 @@ def test_second():
781781

782782
def test_request_getmodulepath(self, testdir):
783783
modcol = testdir.getmodulecol("def test_somefunc(): pass")
784-
item, = testdir.genitems([modcol])
784+
(item,) = testdir.genitems([modcol])
785785
req = fixtures.FixtureRequest(item)
786786
assert req.fspath == modcol.fspath
787787

testing/python/raises.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def test_match_failure_string_quoting(self):
205205
with pytest.raises(AssertionError) as excinfo:
206206
with pytest.raises(AssertionError, match="'foo"):
207207
raise AssertionError("'bar")
208-
msg, = excinfo.value.args
208+
(msg,) = excinfo.value.args
209209
assert msg == 'Pattern "\'foo" not found in "\'bar"'
210210

211211
def test_raises_match_wrong_type(self):

testing/test_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def test_collect_protocol_single_function(self, testdir):
486486
p = testdir.makepyfile("def test_func(): pass")
487487
id = "::".join([p.basename, "test_func"])
488488
items, hookrec = testdir.inline_genitems(id)
489-
item, = items
489+
(item,) = items
490490
assert item.name == "test_func"
491491
newid = item.nodeid
492492
assert newid == id
@@ -605,9 +605,9 @@ def test_serialization_byid(self, testdir):
605605
testdir.makepyfile("def test_func(): pass")
606606
items, hookrec = testdir.inline_genitems()
607607
assert len(items) == 1
608-
item, = items
608+
(item,) = items
609609
items2, hookrec = testdir.inline_genitems(item.nodeid)
610-
item2, = items2
610+
(item2,) = items2
611611
assert item2.name == item.name
612612
assert item2.fspath == item.fspath
613613

@@ -622,7 +622,7 @@ def test_method(self):
622622
arg = p.basename + "::TestClass::test_method"
623623
items, hookrec = testdir.inline_genitems(arg)
624624
assert len(items) == 1
625-
item, = items
625+
(item,) = items
626626
assert item.nodeid.endswith("TestClass::test_method")
627627
# ensure we are reporting the collection of the single test item (#2464)
628628
assert [x.name for x in self.get_reported_items(hookrec)] == ["test_method"]

testing/test_mark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ def test_custom_mark_parametrized(obj_type):
10111011
def test_pytest_param_id_requires_string():
10121012
with pytest.raises(TypeError) as excinfo:
10131013
pytest.param(id=True)
1014-
msg, = excinfo.value.args
1014+
(msg,) = excinfo.value.args
10151015
assert msg == "Expected id to be a string, got <class 'bool'>: True"
10161016

10171017

testing/test_skipping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def test_func():
115115
)
116116

117117
def test_skipif_class(self, testdir):
118-
item, = testdir.getitems(
118+
(item,) = testdir.getitems(
119119
"""
120120
import pytest
121121
class TestClass(object):

testing/test_tmpdir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def test_lock_register_cleanup_removal(self, tmp_path):
258258
registry = []
259259
register_cleanup_lock_removal(lock, register=registry.append)
260260

261-
cleanup_func, = registry
261+
(cleanup_func,) = registry
262262

263263
assert lock.is_file()
264264

0 commit comments

Comments
 (0)