[Python-checkins] python/dist/src/Lib/test test_macostools.py, 1.5,
1.6
bcannon at users.sourceforge.net
bcannon at users.sourceforge.net
Mon Dec 6 07:09:03 CET 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23400/Lib/test
Modified Files:
test_macostools.py
Log Message:
Have test_mkalias_relative check that sys.prefix already exists; otherwise test
is pointless.
Also add a note to the docs for the 'test' package that test cases should check
first that any conditions needed in the operating system are met before having
a test run.
Closes bug #1077302. THanks, Ian Holsman.
Index: test_macostools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_macostools.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- test_macostools.py 27 Feb 2003 23:17:26 -0000 1.5
+++ test_macostools.py 6 Dec 2004 06:08:58 -0000 1.6
@@ -75,6 +75,12 @@
os.unlink(TESTFN2)
except:
pass
+ # If the directory doesn't exist, then chances are this is a new
+ # install of Python so don't create it since the user might end up
+ # running ``sudo make install`` and creating the directory here won't
+ # leave it with the proper permissions.
+ if not os.path.exists(sys.prefix):
+ return
macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
More information about the Python-checkins
mailing list