Skip to content

Commit

Permalink
gh-107909: Test explicit object base in PEP695 generic classes (#10…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Aug 16, 2023
1 parent a8d440b commit b61f599
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/test/test_type_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ def test_disallowed_expressions(self):
check_syntax_error(self, "def f[T: [(x := 3) for _ in range(2)]](): pass")
check_syntax_error(self, "type T = [(x := 3) for _ in range(2)]")

def test_incorrect_mro_explicit_object(self):
with self.assertRaisesRegex(TypeError, r"\(MRO\) for bases object, Generic"):
class My[X](object): ...


class TypeParamsNonlocalTest(unittest.TestCase):
def test_nonlocal_disallowed_01(self):
Expand Down

0 comments on commit b61f599

Please sign in to comment.