mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
gh-133211: Test that PEP750 types are final (#133212)
This commit is contained in:
parent
cc39b19f0f
commit
f7264ddea0
1 changed files with 7 additions and 0 deletions
|
|
@ -18,6 +18,13 @@ def test_common(self):
|
|||
self.assertEqual(type(i).__qualname__, 'Interpolation')
|
||||
self.assertEqual(type(i).__module__, 'string.templatelib')
|
||||
|
||||
def test_final_types(self):
|
||||
with self.assertRaisesRegex(TypeError, 'is not an acceptable base type'):
|
||||
class Sub(Template): ...
|
||||
|
||||
with self.assertRaisesRegex(TypeError, 'is not an acceptable base type'):
|
||||
class Sub(Interpolation): ...
|
||||
|
||||
def test_basic_creation(self):
|
||||
# Simple t-string creation
|
||||
t = t'Hello, world'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue