Skip to content

Commit 2eb32ad

Browse files
authored
gh-139935: do not skip test on real errors in os.getlogin (#139953)
1 parent 897a36b commit 2eb32ad

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Lib/test/test_os/test_os.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,13 +3204,7 @@ def test_getlogin(self):
32043204
user_name = os.getlogin()
32053205
except OSError as exc:
32063206
# See https://man7.org/linux/man-pages/man3/getlogin.3.html#ERRORS.
3207-
allowed_errors = (
3208-
# defined by POSIX
3209-
errno.EMFILE, errno.ENFILE, errno.ENXIO, errno.ERANGE,
3210-
# defined by Linux/glibc
3211-
errno.ENOENT, errno.ENOMEM, errno.ENOTTY,
3212-
)
3213-
if exc.errno in allowed_errors:
3207+
if exc.errno in (errno.ENXIO, errno.ENOENT, errno.ENOTTY):
32143208
self.skipTest(str(exc))
32153209
else:
32163210
raise

0 commit comments

Comments
 (0)