Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dda7fdf

Browse files
author
Hirokazu Yamamoto
committed
Skip estLoadWithUNC when UNC is not available.
1 parent b3b390d commit dda7fdf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/test_tcl.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
import unittest
4+
import sys
45
import os
56
from 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")

0 commit comments

Comments
 (0)