]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Slight reworking of this test. If nis.maps() gives a nis.error, then
authorBarry Warsaw <barry@python.org>
Thu, 28 Jan 1999 04:54:33 +0000 (04:54 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 28 Jan 1999 04:54:33 +0000 (04:54 +0000)
raise an ImportError if not running verbose.  This signals to the
regression framework that this test isn't applicable.

Lib/test/test_nis.py

index b28a6722d2bce8214b31b24b814c5d3ab995847c..b73faf9e89774cbaf7d9645a6afc83290d701a3a 100644 (file)
@@ -3,10 +3,13 @@ import nis
 
 print 'nis.maps()'
 try:
-    # the following could fail if NIS isn't active
     maps = nis.maps()
 except nis.error, msg:
-    raise TestFailed, msg 
+    # NIS is probably not active, so this test isn't useful
+    if verbose:
+        raise TestFailed, msg
+    # only do this if running under the regression suite
+    raise ImportError, msg
 
 done = 0
 for nismap in maps: