summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_errno.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_errno.py')
-rwxr-xr-xLib/test/test_errno.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test_errno.py b/Lib/test/test_errno.py
index bb8918f..f414a87 100755
--- a/Lib/test/test_errno.py
+++ b/Lib/test/test_errno.py
@@ -1,10 +1,10 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""Test the errno module
Roger E. Masse
"""
import errno
-from test import test_support
+from test import support
import unittest
std_c_errors = frozenset(['EDOM', 'ERANGE'])
@@ -19,21 +19,22 @@ class ErrnoAttributeTests(unittest.TestCase):
def test_using_errorcode(self):
# Every key value in errno.errorcode should be on the module.
- for value in errno.errorcode.itervalues():
- self.assertTrue(hasattr(errno, value), 'no %s attr in errno' % value)
+ for value in errno.errorcode.values():
+ self.assertTrue(hasattr(errno, value),
+ 'no %s attr in errno' % value)
class ErrorcodeTests(unittest.TestCase):
def test_attributes_in_errorcode(self):
- for attribute in errno.__dict__.iterkeys():
+ for attribute in errno.__dict__.keys():
if attribute.isupper():
self.assertIn(getattr(errno, attribute), errno.errorcode,
'no %s attr in errno.errorcode' % attribute)
def test_main():
- test_support.run_unittest(ErrnoAttributeTests, ErrorcodeTests)
+ support.run_unittest(ErrnoAttributeTests, ErrorcodeTests)
if __name__ == '__main__':