@@ -712,9 +712,9 @@ def test_parse_makefile(self):
712712
713713
714714class DeprecationTests (unittest .TestCase ):
715- def deprecated (self , removal_version , deprecation_msg = None , attribute_msg = None ):
715+ def deprecated (self , removal_version , deprecation_msg = None , error = Exception , error_msg = None ):
716716 if sys .version_info >= removal_version :
717- return self .assertRaises (AttributeError , msg = attribute_msg )
717+ return self .assertRaises (error , msg = error_msg )
718718 else :
719719 return self .assertWarns (DeprecationWarning , msg = deprecation_msg )
720720
@@ -725,10 +725,24 @@ def test_expand_makefile_vars(self):
725725 'sysconfig.expand_makefile_vars is deprecated and will be removed in '
726726 'Python 3.16. Use sysconfig.get_paths(vars=...) instead.' ,
727727 ),
728- attribute_msg = "module 'sysconfig' has no attribute 'expand_makefile_vars'" ,
728+ error = AttributeError ,
729+ error_msg = "module 'sysconfig' has no attribute 'expand_makefile_vars'" ,
729730 ):
730731 sysconfig .expand_makefile_vars ('' , {})
731732
733+ def test_is_python_build_check_home (self ):
734+ with self .deprecated (
735+ removal_version = (3 , 15 ),
736+ deprecation_msg = (
737+ 'The check_home argument of sysconfig.is_python_build is '
738+ 'deprecated and its value is ignored. '
739+ 'It will be removed in Python 3.15.'
740+ ),
741+ error = TypeError ,
742+ error_msg = "is_python_build() takes 0 positional arguments but 1 were given" ,
743+ ):
744+ sysconfig .is_python_build ('foo' )
745+
732746
733747if __name__ == "__main__" :
734748 unittest .main ()
0 commit comments