Merged revisions 61520,61523-61528,61532 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r61520 | thomas.heller | 2008-03-18 16:03:17 +0100 (Di, 18 Mär 2008) | 5 lines

  Include <alloca.h> on Solaris, see issue #1506.

  It would probably be better to have a configure test for that, but
  this is outside of my configure expertise.
........
  r61523 | brett.cannon | 2008-03-18 16:35:58 +0100 (Di, 18 Mär 2008) | 5 lines

  Remove all traces of HAVE_STRERROR.

  The removal of strerror.c led to the function check being removed from
  configure.in.
........
  r61524 | brett.cannon | 2008-03-18 16:52:00 +0100 (Di, 18 Mär 2008) | 2 lines

  Fix test_errno to only check for error numbers that are defined by Standard C.
........
  r61525 | steven.bethard | 2008-03-18 17:00:19 +0100 (Di, 18 Mär 2008) | 1 line

  Use test_support.unlink instead of os.unlink in tearDown().  (Seems to fix an occasional failure in Windows Vista.)
........
  r61526 | brett.cannon | 2008-03-18 17:47:51 +0100 (Di, 18 Mär 2008) | 3 lines

  Cast the arguments to PyString_AsStringAndSize() to silence compiler warnings
  on OS X.
........
  r61527 | sean.reifschneider | 2008-03-18 18:24:12 +0100 (Di, 18 Mär 2008) | 3 lines

  Issue 1577: shutil.move() where destination is a directory was doing a
  copy, now it is doing a os.rename() if it's on the same file-system.
........
  r61528 | brett.cannon | 2008-03-18 18:25:13 +0100 (Di, 18 Mär 2008) | 12 lines

  Add Tools/scripts/patchcheck.py. Invoked from ``make check``, the script does
  some verification:

  - Runs reindent.py on all .py files.
  - Checks if any changes in Doc exist.
  - Whether Misc/ACKS was changed.
  - Whether Misc/NEWS was changed.

  The hope is that ``make check`` can become a command anybody can run to get
  reminders about what all the requisite steps needed to create a proper
  patch/checkin.
........
  r61532 | neal.norwitz | 2008-03-18 18:58:02 +0100 (Di, 18 Mär 2008) | 1 line

  Get regrtest working when re-running tests
........
This commit is contained in:
Christian Heimes 2008-03-18 18:26:33 +00:00
parent 430865fe26
commit ada8c3b046
10 changed files with 243 additions and 93 deletions

View file

@ -7,61 +7,15 @@ import errno
from test import test_support
import unittest
errors = ['E2BIG', 'EACCES', 'EADDRINUSE', 'EADDRNOTAVAIL', 'EADV',
'EAFNOSUPPORT', 'EAGAIN', 'EALREADY', 'EBADE', 'EBADF',
'EBADFD', 'EBADMSG', 'EBADR', 'EBADRQC', 'EBADSLT',
'EBFONT', 'EBUSY', 'ECHILD', 'ECHRNG', 'ECOMM',
'ECONNABORTED', 'ECONNREFUSED', 'ECONNRESET',
'EDEADLK', 'EDEADLOCK', 'EDESTADDRREQ', 'EDOTDOT', 'EDOM',
'EDQUOT', 'EEXIST', 'EFAULT', 'EFBIG', 'EHOSTDOWN',
'EHOSTUNREACH', 'EIDRM', 'EILSEQ', 'EINPROGRESS',
'EINTR', 'EINVAL', 'EIO', 'EISCONN', 'EISDIR', 'EISNAM',
'EL2HLT', 'EL2NSYNC', 'EL3HLT', 'EL3RST', 'ELIBACC',
'ELIBBAD', 'ELIBEXEC', 'ELIBMAX', 'ELIBSCN', 'ELNRNG',
'ELOOP', 'EMFILE', 'EMLINK', 'EMSGSIZE', 'EMULTIHOP',
'ENAMETOOLONG', 'ENAVAIL', 'ENETDOWN', 'ENETRESET', 'ENETUNREACH',
'ENFILE', 'ENOANO', 'ENOBUFS', 'ENOCSI', 'ENODATA',
'ENODEV', 'ENOENT', 'ENOEXEC', 'ENOLCK', 'ENOLINK',
'ENOMEM', 'ENOMSG', 'ENONET', 'ENOPKG', 'ENOPROTOOPT',
'ENOSPC', 'ENOSR', 'ENOSTR', 'ENOSYS', 'ENOTBLK',
'ENOTCONN', 'ENOTDIR', 'ENOTEMPTY', 'ENOTNAM', 'ENOTOBACCO', 'ENOTSOCK',
'ENOTTY', 'ENOTUNIQ', 'ENXIO', 'EOPNOTSUPP',
'EOVERFLOW', 'EPERM', 'EPFNOSUPPORT', 'EPIPE',
'EPROTO', 'EPROTONOSUPPORT', 'EPROTOTYPE',
'ERANGE', 'EREMCHG', 'EREMOTE', 'EREMOTEIO', 'ERESTART',
'EROFS', 'ESHUTDOWN', 'ESOCKTNOSUPPORT', 'ESPIPE',
'ESRCH', 'ESRMNT', 'ESTALE', 'ESTRPIPE', 'ETIME',
'ETIMEDOUT', 'ETOOMANYREFS', 'ETXTBSY', 'EUCLEAN', 'EUNATCH',
'EUSERS', 'EWOULDBLOCK', 'EXDEV', 'EXFULL',
'WSABASEERR', 'WSADESCRIPTIO', 'WSAEACCES', 'WSAEADDRINUSE',
'WSAEADDRNOTAVAIL', 'WSAEAFNOSUPPORT', 'WSAEALREADY',
'WSAEBADF', 'WSAECONNABORTED', 'WSAECONNREFUSED',
'WSAECONNRESET', 'WSAEDESTADDRREQ', 'WSAEDISCON',
'WSAEDQUOT', 'WSAEFAULT', 'WSAEHOSTDOWN', 'WSAEHOSTUNREACH',
'WSAEINPROGRESS', 'WSAEINTR', 'WSAEINVAL', 'WSAEISCONN',
'WSAELOOP', 'WSAEMFILE', 'WSAEMSGSIZE', 'WSAENAMETOOLONG',
'WSAENETDOWN', 'WSAENETRESET', 'WSAENETUNREACH',
'WSAENOBUFS', 'WSAENOPROTOOPT', 'WSAENOTCONN',
'WSAENOTEMPTY', 'WSAENOTSOCK', 'WSAEOPNOTSUPP',
'WSAEPFNOSUPPORT', 'WSAEPROCLIM', 'WSAEPROTONOSUPPORT',
'WSAEPROTOTYPE', 'WSAEREMOTE', 'WSAESHUTDOWN',
'WSAESOCKTNOSUPPORT', 'WSAESTALE', 'WSAETIMEDOUT',
'WSAETOOMANYREFS', 'WSAEUSERS', 'WSAEWOULDBLOCK',
'WSAGETASYNCBUFLE', 'WSAGETASYNCERRO', 'WSAGETSELECTERRO',
'WSAGETSELECTEVEN', 'WSAHOS', 'WSAMAKEASYNCREPL',
'WSAMAKESELECTREPL', 'WSAN', 'WSANOTINITIALISED', 'WSASY',
'WSASYSNOTREADY', 'WSATR', 'WSAVERNOTSUPPORTED']
std_c_errors = frozenset(['EDOM', 'ERANGE'])
class ErrnoAttributeTests(unittest.TestCase):
def test_for_improper_attributes(self):
# No unexpected attributes should be on the module.
errors_set = set(errors)
for attribute in errno.__dict__.keys():
if attribute.isupper():
self.assert_(attribute in errors_set,
"%s is an unexpected error value" % attribute)
for error_code in std_c_errors:
self.assert_(hasattr(errno, error_code),
"errno is missing %s" % error_code)
def test_using_errorcode(self):
# Every key value in errno.errorcode should be on the module.