summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1997-05-15 18:27:49 (GMT)
committerBarry Warsaw <barry@python.org>1997-05-15 18:27:49 (GMT)
commit4c4d5ce78a9be16fac5e979d40e917a79736f04e (patch)
tree6c90d04f1b9d12746b91a37013989860e63780b8 /Lib
parent1ade44cb0c6b091e008623ca307fdefeb184dfe7 (diff)
downloadcpython-4c4d5ce78a9be16fac5e979d40e917a79736f04e.zip
cpython-4c4d5ce78a9be16fac5e979d40e917a79736f04e.tar.gz
cpython-4c4d5ce78a9be16fac5e979d40e917a79736f04e.tar.bz2
Catch nis.error and raise TestFailed instead. This catches the
problem where Python is configured with the nismodule but NIS isn't installed, or the map names don't correspond to those hardcoded in nismodule.c (which is bogus in and of itself).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_nis.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py
index 9b3910d..0d345fe 100644
--- a/Lib/test/test_nis.py
+++ b/Lib/test/test_nis.py
@@ -1,8 +1,13 @@
-from test_support import verbose
+from test_support import verbose, TestFailed
import nis
print 'nis.maps()'
-maps = nis.maps()
+try:
+ # the following could fail if NIS isn't active
+ maps = nis.maps()
+except nis.error, msg:
+ raise TestFailed, msg
+
done = 0
for nismap in maps:
if verbose: