summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pwd.py
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-12-08 06:20:35 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2013-12-08 06:20:35 (GMT)
commit9fe6d86709b0e769602ff55a6e5a202c440b9d8a (patch)
treeec3d7b1b0cbbd15658459e397c6905964c192331 /Lib/test/test_pwd.py
parent774f909489ca1395ba1e3f3a1f3d43495df6cdfe (diff)
downloadcpython-9fe6d86709b0e769602ff55a6e5a202c440b9d8a.zip
cpython-9fe6d86709b0e769602ff55a6e5a202c440b9d8a.tar.gz
cpython-9fe6d86709b0e769602ff55a6e5a202c440b9d8a.tar.bz2
Issue 19572: More silently skipped tests explicitly skipped.
Diffstat (limited to 'Lib/test/test_pwd.py')
-rw-r--r--Lib/test/test_pwd.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py
index aa8f69f..37a1bcb 100644
--- a/Lib/test/test_pwd.py
+++ b/Lib/test/test_pwd.py
@@ -8,8 +8,6 @@ class PwdTest(unittest.TestCase):
def test_values(self):
entries = pwd.getpwall()
- entriesbyname = {}
- entriesbyuid = {}
for e in entries:
self.assertEqual(len(e), 7)
@@ -32,13 +30,20 @@ class PwdTest(unittest.TestCase):
# for one uid
# self.assertEqual(pwd.getpwuid(e.pw_uid), e)
# instead of this collect all entries for one uid
- # and check afterwards
+ # and check afterwards (done in test_values_extended)
+
+ def test_values_extended(self):
+ entries = pwd.getpwall()
+ entriesbyname = {}
+ entriesbyuid = {}
+
+ if len(entries) > 1000: # Huge passwd file (NIS?) -- skip this test
+ self.skipTest('passwd file is huge; extended test skipped')
+
+ for e in entries:
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: