mirror of https://github.com/python/cpython
gh-121200: Log pwd entry in test_expanduser_pwd2() (#121207)
Use subTest() to log the pwd entry in test_expanduser_pwd2() of test_posixpath to help debugging.
This commit is contained in:
parent
c766ad206e
commit
05a6f8da60
|
@ -359,13 +359,14 @@ class PosixPathTest(unittest.TestCase):
|
||||||
"no home directory on VxWorks")
|
"no home directory on VxWorks")
|
||||||
def test_expanduser_pwd2(self):
|
def test_expanduser_pwd2(self):
|
||||||
pwd = import_helper.import_module('pwd')
|
pwd = import_helper.import_module('pwd')
|
||||||
for e in pwd.getpwall():
|
for entry in pwd.getpwall():
|
||||||
name = e.pw_name
|
name = entry.pw_name
|
||||||
home = e.pw_dir
|
home = entry.pw_dir
|
||||||
home = home.rstrip('/') or '/'
|
home = home.rstrip('/') or '/'
|
||||||
self.assertEqual(posixpath.expanduser('~' + name), home)
|
with self.subTest(pwd=entry):
|
||||||
self.assertEqual(posixpath.expanduser(os.fsencode('~' + name)),
|
self.assertEqual(posixpath.expanduser('~' + name), home)
|
||||||
os.fsencode(home))
|
self.assertEqual(posixpath.expanduser(os.fsencode('~' + name)),
|
||||||
|
os.fsencode(home))
|
||||||
|
|
||||||
NORMPATH_CASES = [
|
NORMPATH_CASES = [
|
||||||
("", "."),
|
("", "."),
|
||||||
|
|
Loading…
Reference in New Issue