Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: py3.5
Changeset: r93533:6276a7287d4b
Date: 2017-12-21 12:38 +0000
http://bitbucket.org/pypy/pypy/changeset/6276a7287d4b/

Log:    Clean up tests

diff --git a/pypy/module/errno/test/test_errno.py 
b/pypy/module/errno/test/test_errno.py
--- a/pypy/module/errno/test/test_errno.py
+++ b/pypy/module/errno/test/test_errno.py
@@ -11,29 +11,11 @@
         assert not hasattr(self.errno, '__file__')
 
     def test_constants(self):
-        host_errorcode = self.errorcode.copy()
-        # On some systems, ENOTSUP is an alias to EOPNOTSUPP.  Adjust the
-        # host_errorcode dictionary in case the host interpreter has slightly
-        # different errorcodes than the interpreter under test
-        if ('ENOTSUP' not in host_errorcode.values() and
-            'ENOTSUP' in self.errno.errorcode.values()):
-            host_errorcode[self.errno.ENOTSUP] = 'ENOTSUP'
-        if ('EOPNOTSUPP' not in host_errorcode.values() and
-            'EOPNOTSUPP' in self.errno.errorcode.values()):
-            host_errorcode[self.errno.EOPNOTSUPP] = 'EOPNOTSUPP'
-        for code, name in host_errorcode.items():
+        # Assumes that our constants are a superset of the host's
+        for code, name in self.errorcode.items():
             assert getattr(self.errno, name) == code
 
     def test_errorcode(self):
-        host_errorcode = self.errorcode.copy()
-        # On some systems, ENOTSUP is an alias to EOPNOTSUPP.  Adjust the
-        # host_errorcode dictionary in case the host interpreter has slightly
-        # different errorcodes than the interpreter under test
-        if ('ENOTSUP' not in host_errorcode.values() and
-            'ENOTSUP' in self.errno.errorcode.values()):
-            host_errorcode[self.errno.ENOTSUP] = 'ENOTSUP'
-        if ('EOPNOTSUPP' not in host_errorcode.values() and
-            'EOPNOTSUPP' in self.errno.errorcode.values()):
-            host_errorcode[self.errno.EOPNOTSUPP] = 'EOPNOTSUPP'
-        for value, name in host_errorcode.items():
+        # Assumes that our codes are a superset of the host's
+        for value, name in self.errorcode.items():
             assert self.errno.errorcode[value] == name
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to