summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posixpath.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-05-09 12:19:45 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-05-09 12:19:45 (GMT)
commitce82d57c7480c7360539c9e606d0b2f620e0c181 (patch)
treed9b4fa2119acf2bc26e672727fadf6c7a48fdb1b /Lib/test/test_posixpath.py
parent263fab94ee1f32b53b709c25c76044719d0eb88e (diff)
downloadcpython-ce82d57c7480c7360539c9e606d0b2f620e0c181.zip
cpython-ce82d57c7480c7360539c9e606d0b2f620e0c181.tar.gz
cpython-ce82d57c7480c7360539c9e606d0b2f620e0c181.tar.bz2
#17809: fix a test failure in test_expanduser when $HOME has a trailing /. Patch by Kubilay Kocak.
Diffstat (limited to 'Lib/test/test_posixpath.py')
-rw-r--r--Lib/test/test_posixpath.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 724c530..0e7d866 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -318,7 +318,8 @@ class PosixPathTest(unittest.TestCase):
# expanduser should fall back to using the password database
del env['HOME']
home = pwd.getpwuid(os.getuid()).pw_dir
- self.assertEqual(posixpath.expanduser("~"), home)
+ # $HOME can end with a trailing /, so strip it (see #17809)
+ self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
def test_normpath(self):
self.assertEqual(posixpath.normpath(""), ".")