]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104057: Fix direct invocation of test_super (#104064)
authorKirill Podoprigora <80244920+Eclips4@users.noreply.github.com>
Mon, 1 May 2023 22:14:49 +0000 (01:14 +0300)
committerGitHub <noreply@github.com>
Mon, 1 May 2023 22:14:49 +0000 (16:14 -0600)
Lib/test/test_super.py

index ed773a3cff2a6d16c2c7fa1cbba3bb496c541d38..698ab48f48eaa1c9b101f93eb93500f2d6184ded 100644 (file)
@@ -359,7 +359,7 @@ class TestSuper(unittest.TestCase):
             def method(self):
                 return super().msg
 
-        with patch("test.test_super.super", MySuper) as m:
+        with patch(f"{__name__}.super", MySuper) as m:
             self.assertEqual(C().method(), "super super")
 
     def test_shadowed_dynamic_two_arg(self):
@@ -373,7 +373,7 @@ class TestSuper(unittest.TestCase):
             def method(self):
                 return super(1, 2).msg
 
-        with patch("test.test_super.super", MySuper) as m:
+        with patch(f"{__name__}.super", MySuper) as m:
             self.assertEqual(C().method(), "super super")
             self.assertEqual(call_args, [(1, 2)])