From: Barry Warsaw Date: Thu, 15 May 1997 18:27:49 +0000 (+0000) Subject: Catch nis.error and raise TestFailed instead. This catches the X-Git-Tag: v1.5a3~545 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c4d5ce78a9be16fac5e979d40e917a79736f04e;p=thirdparty%2FPython%2Fcpython.git 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). --- diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py index 9b3910d614f5..0d345fe5c2ca 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: