Commit Graph

24 Commits

Author SHA1 Message Date
Georg Brandl 7f0c3ffad5 Merged revisions 83201 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83201 | georg.brandl | 2010-07-28 10:19:35 +0200 (Mi, 28 Jul 2010) | 1 line

  #9354: Provide getsockopt() in asyncore file_wrapper().  Patch by Lukas Langa.
........
2010-08-01 21:18:52 +00:00
Ezio Melotti 3ff4463b35 Merged revisions 83183,83186 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83183 | ezio.melotti | 2010-07-28 01:03:33 +0300 (Wed, 28 Jul 2010) | 1 line

  Use proper skips and assert* methods in test_asyncore.
........
  r83186 | ezio.melotti | 2010-07-28 01:24:13 +0300 (Wed, 28 Jul 2010) | 1 line

  With skipUnless there is no need to add test classes conditionally.
........
2010-07-27 23:45:05 +00:00
Giampaolo Rodolà e3a84e857f Fix issue #8573 (asyncore._strerror bug): fixed os.strerror typo; included NameError in the tuple of expected exception; added test case for asyncore._strerror. 2010-05-18 20:04:31 +00:00
Giampaolo Rodolà fd25594aa4 Removed the assertion that dispatcher.connected attribute must be False after a single connect() call. Solaris and FreeBSD buildbots failures showed how connect() can succeed even in a single call. All bo failures should definitively be fixed now. 2010-05-12 00:29:27 +00:00
Giampaolo Rodolà ff46d6e844 Issue #8490: adds a more solid test suite for asyncore 2010-05-10 15:33:22 +00:00
Giampaolo Rodolà f7454fa98d Fix asyncore issues 8573 and 8483: _strerror might throw ValueError; asyncore.__getattr__ cheap inheritance caused confusing error messages when accessing undefined class attributes; added an alias for __str__ which now is used as a fallback for __repr__ 2010-05-06 17:57:06 +00:00
Victor Stinner 6a10281d33 Issue #7449, last part (11): fix many tests if thread support is disabled
* Use try/except ImportError or test_support.import_module() to import thread
   and threading modules
 * Add @unittest.skipUnless(threading, ...) to testcases using threads
2010-04-27 23:55:59 +00:00
Antoine Pitrou f829d1f551 Suppress transient refleaks in test_asyncore 2009-10-27 18:36:47 +00:00
R. David Murray dcad046d39 Adjust test_asyncore to account for intentional asyncore behavior change
introduced by r70934 that was causing a test failure when run under -O.
2009-04-13 01:06:46 +00:00
R. David Murray 5331d4b4de Make test_asyncore tests match code changes introduced by the
fix to Issue1161031, refactoring the test to simplify it in
the process.
2009-04-11 17:52:56 +00:00
Josiah Carlson bb94d43dcd Fix for failing asyncore tests. 2009-04-01 01:28:11 +00:00
Hirokazu Yamamoto 3e7dd78344 Issue #3759: test_asyncore.py leaked handle.
Reviewed by Amaury Forgeot d'Arc
2008-09-02 20:36:44 +00:00
Josiah Carlson 873c3864ba Fixed test for asyncore. 2008-07-11 23:26:59 +00:00
Josiah Carlson ff5f42088b Fixed bugs 760475, 953599, and 1519. 2008-07-07 04:51:46 +00:00
Martin v. Löwis 06510b2213 Run svneol.py on all sources. 2008-06-13 22:38:33 +00:00
Josiah Carlson b67b53db51 Fixed test to reflect new filedispatcher semantics, as well as two
NameErrors pointed out by Giampaolo.
2008-06-10 15:58:19 +00:00
Josiah Carlson 1a72d88abf Applying updated patch from Issue 1736190, which addresses partial
issues in: 909005 and 17361001, as well as completely as possible issues
539444, 760475, 777588, 889153, 953599, 1025525, 1063924, and 658749.
This patch also includes doc and test updates as necessary.
2008-06-10 05:00:08 +00:00
Trent Nelson e41b0061dd - Issue #2550: The approach used by client/server code for obtaining ports
to listen on in network-oriented tests has been refined in an effort to
  facilitate running multiple instances of the entire regression test suite
  in parallel without issue.  test_support.bind_port() has been fixed such
  that it will always return a unique port -- which wasn't always the case
  with the previous implementation, especially if socket options had been
  set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
  new implementation of bind_port() will actually raise an exception if it
  is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
  SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
  will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
  This currently only applies to Windows.  This option prevents any other
  sockets from binding to the host/port we've bound to, thus removing the
  possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
  that occurs when a second SOCK_STREAM socket binds and accepts to a
  host/port that's already been bound by another socket.  The optional
  preferred port parameter to bind_port() has been removed.  Under no
  circumstances should tests be hard coding ports!

  test_support.find_unused_port() has also been introduced, which will pass
  a temporary socket object to bind_port() in order to obtain an unused port.
  The temporary socket object is then closed and deleted, and the port is
  returned.  This method should only be used for obtaining an unused port
  in order to pass to an external program (i.e. the -accept [port] argument
  to openssl's s_server mode) or as a parameter to a server-oriented class
  that doesn't give you direct access to the underlying socket used.

  Finally, test_support.HOST has been introduced, which should be used for
  the host argument of any relevant socket calls (i.e. bind and connect).

  The following tests were updated to following the new conventions:
    test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
    test_poplib, test_ftplib, test_telnetlib, test_socketserver,
    test_asynchat and test_socket_ssl.

  It is now possible for multiple instances of the regression test suite to
  run in parallel without issue.
2008-04-08 23:47:30 +00:00
Facundo Batista 8eab424fb5 Moved all of the capture_server socket setup code into the try block
so that the event gets set if a failure occurs during server setup
(otherwise the test will block forever).  Changed to let the OS assign
the server port number, and client side of test waits for port number
assignment before proceeding. The test data in DispatcherWithSendTests
is also sent in multiple send() calls instead of one to make sure this
works properly. [GSoC - Alan McIntyre]
2007-07-28 14:21:22 +00:00
Facundo Batista 7f4f41255f Selectively enable tests for asyncore.readwrite based on the presence
of poll support in the select module (since this is the only case in
which readwrite can be called). [GSoC - Alan McIntyre]
2007-07-22 00:13:00 +00:00
Facundo Batista b1994b4a5d Added a select.select call in the test server loop to make sure the
socket is ready to be read from before attempting a read (this
prevents an error 10035 on some Windows platforms). [GSoC - Alan
McIntyre]
2007-07-19 23:57:38 +00:00
Facundo Batista 78e19616f3 Prevent asyncore.dispatcher tests from hanging by adding loop counters
to server & client, and by adding asyncore.close_all calls in
tearDown. Also choose correct expected logging results based on the
value of __debug__  [Alan McIntyre - GSoC]
2007-07-17 02:19:39 +00:00
Facundo Batista 66263cf151 Changed the used port and commented out some tests that uses
a non documented function that appers to uses resources
not present in Windows.
2007-07-15 20:30:39 +00:00
Facundo Batista f47bc182f1 First version. Includes tests for helper functions: read, write,
_exception, readwrite, closeall, compact_traceback; and for classes
dispatcher, dispatcher_with_send, and file_wrapper.
[Alan McIntyre - GSoC]
2007-07-14 22:41:45 +00:00