diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-03-19 16:50:13 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-03-19 16:50:13 (GMT) |
commit | 7919d98d566c7c1491636e69d61b816358023914 (patch) | |
tree | 9c9d3333a9703290772581e2153d9e0bb04c5284 /Lib | |
parent | 12b580b2c6f9af180d7c66910f4fa4c1a26e2d41 (diff) | |
download | cpython-7919d98d566c7c1491636e69d61b816358023914.zip cpython-7919d98d566c7c1491636e69d61b816358023914.tar.gz cpython-7919d98d566c7c1491636e69d61b816358023914.tar.bz2 |
test_nis would fail if test.test_support.verbose was true but NIS was not set
up on the machine.
Closes issue2411. Thanks Michael Bishop.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_nis.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py index 590868f..c958d4b 100644 --- a/Lib/test/test_nis.py +++ b/Lib/test/test_nis.py @@ -1,4 +1,4 @@ -from test.test_support import verbose, run_unittest +from test import test_support import unittest import nis @@ -8,8 +8,10 @@ class NisTests(unittest.TestCase): maps = nis.maps() except nis.error, msg: # NIS is probably not active, so this test isn't useful - if verbose: - self.fail("(failing because of verbose mode) %s" % msg) + if test_support.verbose: + print "Test Skipped:", msg + # Can't raise TestSkipped as regrtest only recognizes the exception + # import time. return try: # On some systems, this map is only accessible to the @@ -35,7 +37,7 @@ class NisTests(unittest.TestCase): break def test_main(): - run_unittest(NisTests) + test_support.run_unittest(NisTests) if __name__ == '__main__': test_main() |