test_rotor.py: New test of the rotor module.
test_*: converted to the new test harness. GvR note! test_signal.py
works interatively (i.e. when verbose=1) but does not work inside the
test harness. It must be a timing issue, but I haven't figured it out
yet.
diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py
index b182d02..1c2208d 100644
--- a/Lib/test/test_pwd.py
+++ b/Lib/test/test_pwd.py
@@ -1,10 +1,8 @@
+from test_support import verbose
import pwd
import string
-verbose = 0
-if __name__ == '__main__':
- verbose = 1
-
+print 'pwd.getpwall()'
entries = pwd.getpwall()
for e in entries:
@@ -12,12 +10,16 @@
uid = e[2]
if verbose:
print name, uid
+ print 'pwd.getpwuid()'
dbuid = pwd.getpwuid(uid)
if dbuid[0] <> name:
print 'Mismatch in pwd.getpwuid()'
+ print 'pwd.getpwnam()'
dbname = pwd.getpwnam(name)
if dbname[2] <> uid:
print 'Mismatch in pwd.getpwnam()'
+ else:
+ print 'name matches uid'
break
# try to get some errors
@@ -53,7 +55,7 @@
try:
pwd.getpwnam(fakename)
except KeyError:
- pass
+ print 'caught expected exception'
else:
print 'fakename', fakename, 'did not except pwd.getpwnam()'
@@ -65,6 +67,6 @@
try:
pwd.getpwuid(fakeuid)
except KeyError:
- pass
+ print 'caught expected exception'
else:
print 'fakeuid', fakeuid, 'did not except pwd.getpwuid()'