diff options
author | Guido van Rossum <guido@python.org> | 2008-01-23 01:20:26 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2008-01-23 01:20:26 +0000 |
commit | 2c634425863d034965857cb0092fa98c4b3832e6 (patch) | |
tree | c12f5dc394af066420bbab41922a210ab02fdb88 | |
parent | 7bf216b03473873f51551c7903bb3bb2ed14a2dd (diff) | |
download | cpython-git-2c634425863d034965857cb0092fa98c4b3832e6.tar.gz |
Backport r60208, skip some tests for huge passwd/group files.
-rwxr-xr-x | Lib/test/test_grp.py | 3 | ||||
-rw-r--r-- | Lib/test/test_pwd.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py index 08958ba071..a8dcb631f4 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 12d2bc9911..74ce9475f9 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: |