diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2013-12-08 06:20:35 (GMT) |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2013-12-08 06:20:35 (GMT) |
commit | 9fe6d86709b0e769602ff55a6e5a202c440b9d8a (patch) | |
tree | ec3d7b1b0cbbd15658459e397c6905964c192331 /Lib/test/test_pwd.py | |
parent | 774f909489ca1395ba1e3f3a1f3d43495df6cdfe (diff) | |
download | cpython-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.py | 17 |
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: |