@@ -777,33 +777,11 @@ def test_pytype_fromspec_with_repeated_slots(self):
777777 with self .assertRaises (SystemError ):
778778 _testcapi .create_type_from_repeated_slots (variant )
779779
780- @warnings_helper .ignore_warnings (category = DeprecationWarning )
781780 def test_immutable_type_with_mutable_base (self ):
782- # Add deprecation warning here so it's removed in 3.14
783- warnings ._deprecated (
784- 'creating immutable classes with mutable bases' , remove = (3 , 14 ))
785-
786- class MutableBase :
787- def meth (self ):
788- return 'original'
789-
790- with self .assertWarns (DeprecationWarning ):
791- ImmutableSubclass = _testcapi .make_immutable_type_with_base (
792- MutableBase )
793- instance = ImmutableSubclass ()
781+ class MutableBase : ...
794782
795- self .assertEqual (instance .meth (), 'original' )
796-
797- # Cannot override the static type's method
798- with self .assertRaisesRegex (
799- TypeError ,
800- "cannot set 'meth' attribute of immutable type" ):
801- ImmutableSubclass .meth = lambda self : 'overridden'
802- self .assertEqual (instance .meth (), 'original' )
803-
804- # Can change the method on the mutable base
805- MutableBase .meth = lambda self : 'changed'
806- self .assertEqual (instance .meth (), 'changed' )
783+ with self .assertRaisesRegex (TypeError , 'Creating immutable type' ):
784+ _testcapi .make_immutable_type_with_base (MutableBase )
807785
808786 def test_pynumber_tobase (self ):
809787 from _testcapi import pynumber_tobase
0 commit comments