diff --git a/Lib/test/test_string/test_templatelib.py b/Lib/test/test_string/test_templatelib.py index 5cf187828510c4..5221ca673b24ec 100644 --- a/Lib/test/test_string/test_templatelib.py +++ b/Lib/test/test_string/test_templatelib.py @@ -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'