https://github.com/python/cpython/commit/2eb32add92d553b320850975442fa2e55addc377
commit: 2eb32add92d553b320850975442fa2e55addc377
branch: main
author: Bénédikt Tran <[email protected]>
committer: picnixz <[email protected]>
date: 2025-10-11T16:31:34+02:00
summary:

gh-139935: do not skip test on real errors in `os.getlogin` (#139953)

files:
M Lib/test/test_os/test_os.py

diff --git a/Lib/test/test_os/test_os.py b/Lib/test/test_os/test_os.py
index 95b175db6fcdcb..e074858fe2ad99 100644
--- a/Lib/test/test_os/test_os.py
+++ b/Lib/test/test_os/test_os.py
@@ -3204,13 +3204,7 @@ def test_getlogin(self):
             user_name = os.getlogin()
         except OSError as exc:
             # See https://man7.org/linux/man-pages/man3/getlogin.3.html#ERRORS.
-            allowed_errors = (
-                # defined by POSIX
-                errno.EMFILE, errno.ENFILE, errno.ENXIO, errno.ERANGE,
-                # defined by Linux/glibc
-                errno.ENOENT, errno.ENOMEM, errno.ENOTTY,
-            )
-            if exc.errno in allowed_errors:
+            if exc.errno in (errno.ENXIO, errno.ENOENT, errno.ENOTTY):
                 self.skipTest(str(exc))
             else:
                 raise

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to