https://github.com/python/cpython/commit/7bd67d56c4fea7a9cbbd1282704f083e5ecf418b
commit: 7bd67d56c4fea7a9cbbd1282704f083e5ecf418b
branch: 3.13
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: vstinner <vstin...@python.org>
date: 2024-07-01T10:09:01Z
summary:

[3.13] gh-121200: Log pwd entry in test_expanduser_pwd2() (GH-121207) (#121213)

gh-121200: Log pwd entry in test_expanduser_pwd2() (GH-121207)

Use subTest() to log the pwd entry in test_expanduser_pwd2() of
test_posixpath to help debugging.
(cherry picked from commit 05a6f8da6042cc87da1cd3824c1375d12753e5a1)

Co-authored-by: Victor Stinner <vstin...@python.org>

files:
M Lib/test/test_posixpath.py

diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 57a24e9c70d5e5..9f36a4cd9ce43f 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -359,13 +359,14 @@ def test_expanduser_pwd(self):
                      "no home directory on VxWorks")
     def test_expanduser_pwd2(self):
         pwd = import_helper.import_module('pwd')
-        for e in pwd.getpwall():
-            name = e.pw_name
-            home = e.pw_dir
+        for entry in pwd.getpwall():
+            name = entry.pw_name
+            home = entry.pw_dir
             home = home.rstrip('/') or '/'
-            self.assertEqual(posixpath.expanduser('~' + name), home)
-            self.assertEqual(posixpath.expanduser(os.fsencode('~' + name)),
-                             os.fsencode(home))
+            with self.subTest(pwd=entry):
+                self.assertEqual(posixpath.expanduser('~' + name), home)
+                self.assertEqual(posixpath.expanduser(os.fsencode('~' + name)),
+                                 os.fsencode(home))
 
     NORMPATH_CASES = [
         ("", "."),

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to