summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_nis.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_nis.py')
-rw-r--r--Lib/test/test_nis.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py
index 21074c6..2a9f2a8 100644
--- a/Lib/test/test_nis.py
+++ b/Lib/test/test_nis.py
@@ -1,15 +1,13 @@
-from test import support
+from test import test_support
import unittest
-# Skip test if nis module does not exist.
-nis = support.import_module('nis')
-
+nis = test_support.import_module('nis')
class NisTests(unittest.TestCase):
def test_maps(self):
try:
maps = nis.maps()
- except nis.error as msg:
+ except nis.error, msg:
# NIS is probably not active, so this test isn't useful
self.skipTest(str(msg))
try:
@@ -35,5 +33,8 @@ class NisTests(unittest.TestCase):
if done:
break
+def test_main():
+ test_support.run_unittest(NisTests)
+
if __name__ == '__main__':
- unittest.main()
+ test_main()