diff options
author | Brett Cannon <bcannon@gmail.com> | 2004-12-06 06:08:59 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2004-12-06 06:08:59 (GMT) |
commit | c8aa848ece8b6745ffe905eff9202c041c2405e1 (patch) | |
tree | 47acc76dbbbc3a297f3007f0a8fbdcc64beadee5 /Lib/test/test_macostools.py | |
parent | 98809b76ae6f683cb41f370297b01fa466870761 (diff) | |
download | cpython-c8aa848ece8b6745ffe905eff9202c041c2405e1.zip cpython-c8aa848ece8b6745ffe905eff9202c041c2405e1.tar.gz cpython-c8aa848ece8b6745ffe905eff9202c041c2405e1.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_macostools.py')
-rw-r--r-- | Lib/test/test_macostools.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_macostools.py b/Lib/test/test_macostools.py index 9ed2d81..f3292ce 100644 --- a/Lib/test/test_macostools.py +++ b/Lib/test/test_macostools.py @@ -75,6 +75,12 @@ class TestMacostools(unittest.TestCase): 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)) |