File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
33import unittest
4+ import sys
45import os
56from test import support
67
@@ -127,21 +128,20 @@ def testPackageRequireException(self):
127128 tcl = self .interp
128129 self .assertRaises (TclError ,tcl .eval ,'package require DNE' )
129130
131+ @unittest .skipUnless (sys .platform == 'win32' , 'Requires Windows' )
130132 def testLoadWithUNC (self ):
131- import sys
132- if sys .platform != 'win32' :
133- return
134-
135133 # Build a UNC path from the regular path.
136134 # Something like
137135 # \\%COMPUTERNAME%\c$\python27\python.exe
138136
139137 fullname = os .path .abspath (sys .executable )
140138 if fullname [1 ] != ':' :
141- return
139+ raise unittest . SkipTest ( 'Absolute path should have drive part' )
142140 unc_name = r'\\%s\%s$\%s' % (os .environ ['COMPUTERNAME' ],
143141 fullname [0 ],
144142 fullname [3 :])
143+ if not os .path .exists (unc_name ):
144+ raise unittest .SkipTest ('Cannot connect to UNC Path' )
145145
146146 with support .EnvironmentVarGuard () as env :
147147 env .unset ("TCL_LIBRARY" )
You can’t perform that action at this time.
0 commit comments