From 168e73d25e965888aa307fd74de597a35b660e1b Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Tue, 1 Jul 2003 03:33:31 +0000 Subject: Fix SF #763362, test_posixpath failed Don't check expanduser('~') if the home directory == the root directory (ie, we are running as root). --- Lib/test/test_posixpath.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py index 37e9628..fcf2ef5 100644 --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -338,10 +338,12 @@ class PosixPathTest(unittest.TestCase): pass else: self.assert_(isinstance(posixpath.expanduser("~/"), basestring)) - self.assertEqual( - posixpath.expanduser("~") + "/", - posixpath.expanduser("~/") - ) + # if home directory == root directory, this test makes no sense + if posixpath.expanduser("~") != '/': + self.assertEqual( + posixpath.expanduser("~") + "/", + posixpath.expanduser("~/") + ) self.assert_(isinstance(posixpath.expanduser("~root/"), basestring)) self.assert_(isinstance(posixpath.expanduser("~foo/"), basestring)) -- cgit v0.12