diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8962a9b36..75f6e805a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,6 +13,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: debug-statements + exclude: _pytest/debugging.py - id: flake8 - repo: https://github.com/asottile/pyupgrade rev: v1.2.0 diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py index 5bbe94db8..ca1680dd3 100644 --- a/_pytest/fixtures.py +++ b/_pytest/fixtures.py @@ -218,7 +218,7 @@ def reorder_items_atscope(items, argkeys_cache, items_by_argkey, scopenum): break if no_argkey_group: no_argkey_group = reorder_items_atscope( - no_argkey_group, argkeys_cache, items_by_argkey, scopenum + 1) + no_argkey_group, argkeys_cache, items_by_argkey, scopenum + 1) for item in no_argkey_group: items_done[item] = None ignore.add(slicing_argkey) @@ -682,10 +682,10 @@ class FixtureLookupErrorRepr(TerminalRepr): lines = self.errorstring.split("\n") if lines: tw.line('{} {}'.format(FormattedExcinfo.fail_marker, - lines[0].strip()), red=True) + lines[0].strip()), red=True) for line in lines[1:]: tw.line('{} {}'.format(FormattedExcinfo.flow_marker, - line.strip()), red=True) + line.strip()), red=True) tw.line() tw.line("%s:%d" % (self.filename, self.firstlineno + 1)) @@ -854,7 +854,7 @@ class FixtureFunctionMarker(object): if getattr(function, "_pytestfixturefunction", False): raise ValueError( - "fixture is being applied more than once to the same function") + "fixture is being applied more than once to the same function") function._pytestfixturefunction = self return function diff --git a/_pytest/recwarn.py b/_pytest/recwarn.py index 7f9fcb30a..0f803a624 100644 --- a/_pytest/recwarn.py +++ b/_pytest/recwarn.py @@ -227,7 +227,9 @@ class WarningsChecker(WarningsRecorder): if re.compile(self.match_expr).search(str(r.message)): break else: - fail("DID NOT WARN. No warnings of type {} matching" - " ('{}') was emitted. The list of emitted warnings" - " is: {}.".format(self.expected_warning, self.match_expr, - [each.message for each in self])) + fail( + "DID NOT WARN. No warnings of type {} matching" + " ('{}') was emitted. The list of emitted warnings" + " is: {}.".format( + self.expected_warning, self.match_expr, + [each.message for each in self])) diff --git a/testing/test_mark.py b/testing/test_mark.py index f79baf0fc..ae8fe79b2 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -747,8 +747,10 @@ class TestFunctional(object): items = {x.name: x for x in items} for name, expected_markers in expected.items(): markers = items[name].keywords._markers - marker_names = {name for (name, v) in markers.items() - if isinstance(v, MarkInfo)} + marker_names = { + name for (name, v) in markers.items() + if isinstance(v, MarkInfo) + } assert marker_names == set(expected_markers) @pytest.mark.issue1540