diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-10-06 02:41:59 +0000 |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-10-06 02:41:59 +0000 |
commit | 18c4e8734c7d817163e2c6564eedc246a2c9aa58 (patch) | |
tree | 903479501562b40a1f915e307d9aace19ca93b35 | |
parent | 6e5e50104c90501477e1ecc739e563f0f9b1129d (diff) | |
download | cpython-git-18c4e8734c7d817163e2c6564eedc246a2c9aa58.tar.gz |
More strict test. Consider the case sys.executable itself is symlink.
-rw-r--r-- | Lib/test/test_platform.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 5024737db9..2fa13096ee 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -17,12 +17,13 @@ class PlatformTest(unittest.TestCase): 'import platform; print platform.architecture()'] p = subprocess.Popen(cmd, stdout=subprocess.PIPE) return p.communicate() - symlink = os.path.abspath(test_support.TESTFN) - os.symlink(sys.executable, symlink) + real = os.path.realpath(sys.executable) + link = os.path.abspath(test_support.TESTFN) + os.symlink(real, link) try: - self.assertEqual(get(sys.executable), get(symlink)) + self.assertEqual(get(real), get(link)) finally: - os.remove(symlink) + os.remove(link) def test_machine(self): res = platform.machine() |