From 2c634425863d034965857cb0092fa98c4b3832e6 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 23 Jan 2008 01:20:26 +0000 Subject: [PATCH] Backport r60208, skip some tests for huge passwd/group files. --- Lib/test/test_grp.py | 3 +++ Lib/test/test_pwd.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py index 08958ba0716..a8dcb631f4d 100755 --- a/Lib/test/test_grp.py +++ b/Lib/test/test_grp.py @@ -25,6 +25,9 @@ class GroupDatabaseTestCase(unittest.TestCase): for e in entries: self.check_value(e) + if len(entries) > 1000: # Huge group file (NIS?) -- skip the rest + return + for e in entries: e2 = grp.getgrgid(e.gr_gid) self.check_value(e2) diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py index 12d2bc9911a..74ce9475f90 100644 --- a/Lib/test/test_pwd.py +++ b/Lib/test/test_pwd.py @@ -35,6 +35,9 @@ class PwdTest(unittest.TestCase): entriesbyname.setdefault(e.pw_name, []).append(e) entriesbyuid.setdefault(e.pw_uid, []).append(e) + if len(entries) > 1000: # Huge passwd file (NIS?) -- skip the rest + return + # check whether the entry returned by getpwuid() # for each uid is among those from getpwall() for this uid for e in entries: