File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 66 import crypt
77 IMPORT_ERROR = None
88except ImportError as ex :
9+ if sys .platform != 'win32' :
10+ raise unittest .SkipTest (str (ex ))
911 crypt = None
1012 IMPORT_ERROR = str (ex )
1113
1214
13- @unittest .skipIf (crypt , 'This should only run on windows' )
15+ @unittest .skipUnless (sys .platform == 'win32' , 'This should only run on windows' )
16+ @unittest .skipIf (crypt , 'import succeeded' )
1417class TestWhyCryptDidNotImport (unittest .TestCase ):
15- def test_failure_only_for_windows (self ):
16- self .assertEqual (sys .platform , 'win32' )
1718
1819 def test_import_failure_message (self ):
1920 self .assertIn ('not supported' , IMPORT_ERROR )
2021
2122
22- @unittest .skipUnless (crypt , 'Not supported on Windows ' )
23+ @unittest .skipUnless (crypt , 'crypt module is required ' )
2324class CryptTestCase (unittest .TestCase ):
2425
2526 def test_crypt (self ):
You can’t perform that action at this time.
0 commit comments