Skip to content

[3.13] gh-133122: Fix for test_type_lookup_mro_reference. #133127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Lib/test/test_descr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5177,10 +5177,15 @@ class Base2(object):

with self.assertWarnsRegex(RuntimeWarning, 'X'):
X = type('X', (Base,), {MyKey(): 5})

# Note that the access below uses getattr() rather than normally
# accessing the attribute. That is done to avoid the bytecode
# specializer activating on repeated runs of the test.

# mykey is read from Base
self.assertEqual(X.mykey, 'from Base')
self.assertEqual(getattr(X, 'mykey'), 'from Base')
# mykey2 is read from Base2 because MyKey.__eq__ has set __bases__
self.assertEqual(X.mykey2, 'from Base2')
self.assertEqual(getattr(X, 'mykey2'), 'from Base2')


class PicklingTests(unittest.TestCase):
Expand Down
Loading