File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 import ssl
2222except ImportError :
2323 ssl = None
24- import warnings
2524
2625support .requires_working_socket (module = True )
2726
@@ -605,14 +604,11 @@ def test_unselect(self):
605604
606605 # property tests
607606
608- def test_file_property (self ):
607+ def test_file_property_should_not_be_accessed (self ):
609608 client , _ = self ._setup (SimpleIMAPHandler )
610- # 'file' attribute access should trigger a warning
611- with warnings .catch_warnings (record = True ) as warned :
612- warnings .simplefilter ('always' )
609+ # the 'file' property replaced a private attribute that is now unsafe
610+ with self .assertWarns (RuntimeWarning ):
613611 client .file
614- self .assertEqual (len (warned ), 1 )
615- self .assertTrue (issubclass (warned [- 1 ].category , RuntimeWarning ))
616612
617613
618614class NewIMAPTests (NewIMAPTestsMixin , unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments