[Python-checkins] r84974 - python/branches/py3k/Lib/test/test_tcl.py
hirokazu.yamamoto
python-checkins at python.org
Thu Sep 23 17:28:36 CEST 2010
Author: hirokazu.yamamoto
Date: Thu Sep 23 17:28:35 2010
New Revision: 84974
Log:
Skip estLoadWithUNC when UNC is not available.
Modified:
python/branches/py3k/Lib/test/test_tcl.py
Modified: python/branches/py3k/Lib/test/test_tcl.py
==============================================================================
--- python/branches/py3k/Lib/test/test_tcl.py (original)
+++ python/branches/py3k/Lib/test/test_tcl.py Thu Sep 23 17:28:35 2010
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import unittest
+import sys
import os
from test import support
@@ -127,21 +128,20 @@
tcl = self.interp
self.assertRaises(TclError,tcl.eval,'package require DNE')
+ @unittest.skipUnless(sys.platform == 'win32', 'Requires Windows')
def testLoadWithUNC(self):
- import sys
- if sys.platform != 'win32':
- return
-
# Build a UNC path from the regular path.
# Something like
# \\%COMPUTERNAME%\c$\python27\python.exe
fullname = os.path.abspath(sys.executable)
if fullname[1] != ':':
- return
+ raise unittest.SkipTest('Absolute path should have drive part')
unc_name = r'\\%s\%s$\%s' % (os.environ['COMPUTERNAME'],
fullname[0],
fullname[3:])
+ if not os.path.exists(unc_name):
+ raise unittest.SkipTest('Cannot connect to UNC Path')
with support.EnvironmentVarGuard() as env:
env.unset("TCL_LIBRARY")
More information about the Python-checkins
mailing list