File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -702,9 +702,25 @@ def test_attributes(self):
702702 absent = object ()
703703 with self .assertWarnsRegex (
704704 DeprecationWarning ,
705- r'sys\.abiflags will be set.*on all platforms' ,
705+ r'sys\.abiflags will be set\b.*\bon all platforms' ,
706706 ):
707707 self .assertIs (getattr (sys , 'abiflags' , absent ), absent )
708+ with self .assertWarnsRegex (
709+ DeprecationWarning ,
710+ r'sys\.abiflags will be set\b.*\bon all platforms' ,
711+ ):
712+ self .assertFalse (hasattr (sys , 'abiflags' ))
713+
714+ # Emit a deprecated warning and also raise an AttributeError
715+ with self .assertRaisesRegex (
716+ AttributeError ,
717+ r"module 'sys' has no attribute 'abiflags'" ,
718+ ):
719+ with self .assertWarnsRegex (
720+ DeprecationWarning ,
721+ r'sys\.abiflags will be set\b.*\bon all platforms' ,
722+ ):
723+ _ = sys .abiflags
708724
709725 def test_thread_info (self ):
710726 info = sys .thread_info
You can’t perform that action at this time.
0 commit comments