gh-104057: Fix direct invocation of test_super (#104064)

This commit is contained in:
Kirill Podoprigora 2023-05-02 01:14:49 +03:00 committed by GitHub
parent 80b714835d
commit 605f8785db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -359,7 +359,7 @@ class TestSuper(unittest.TestCase):
def method(self): def method(self):
return super().msg 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") self.assertEqual(C().method(), "super super")
def test_shadowed_dynamic_two_arg(self): def test_shadowed_dynamic_two_arg(self):
@ -373,7 +373,7 @@ class TestSuper(unittest.TestCase):
def method(self): def method(self):
return super(1, 2).msg 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(C().method(), "super super")
self.assertEqual(call_args, [(1, 2)]) self.assertEqual(call_args, [(1, 2)])