diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 1a41f6627..25e1ce075 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -605,7 +605,9 @@ class AssertionRewriter(ast.NodeVisitor): self.module_path = module_path self.config = config if config is not None: - self.enable_assertion_pass_hook = config.getini("enable_assertion_pass_hook") + self.enable_assertion_pass_hook = config.getini( + "enable_assertion_pass_hook" + ) else: self.enable_assertion_pass_hook = False diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 040972791..129eca680 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1308,7 +1308,6 @@ class TestEarlyRewriteBailout: class TestAssertionPass: - def test_hook_call(self, testdir): testdir.makeconftest( """ @@ -1317,10 +1316,12 @@ class TestAssertionPass: """ ) - testdir.makeini(""" + testdir.makeini( + """ [pytest] enable_assertion_pass_hook = True - """) + """ + ) testdir.makepyfile( """ @@ -1349,10 +1350,12 @@ class TestAssertionPass: _pytest.assertion.rewrite, "_call_assertion_pass", raise_on_assertionpass ) - testdir.makeini(""" + testdir.makeini( + """ [pytest] enable_assertion_pass_hook = True - """) + """ + ) testdir.makepyfile( """ @@ -1386,10 +1389,12 @@ class TestAssertionPass: """ ) - testdir.makeini(""" + testdir.makeini( + """ [pytest] enable_assertion_pass_hook = False - """) + """ + ) testdir.makepyfile( """