Commit Graph

56 Commits

Author SHA1 Message Date
Victor Stinner 623138c163 Issue #11453, #18174: Fix leak of file descriptor in test_asyncore 2014-07-29 01:01:09 +02:00
Victor Stinner 4d4c69dc35 Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper
object is destroyed. The destructor now closes the file if needed. The close()
method can now be called twice: the second call does nothing.
2014-06-27 23:52:03 +02:00
Victor Stinner 252d40ef1e Closes #21582: Cleanup test_asyncore. Patch written by diana.
- Use support.captured_stderr() where appropriate
- Removes some "from test.support import xxx" import and uses support.xxx
  instead.
2014-06-27 22:44:40 +02:00
Victor Stinner daf455554b Issue #18571: Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
2013-08-28 00:53:59 +02:00
Antoine Pitrou f6fbf56071 Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as possible, since "localhost" goes through a DNS lookup under recent Windows versions. 2013-08-22 00:39:46 +02:00
Giampaolo Rodola' 3cb09064a3 Issue #17992: Add timeouts to asyncore and asynchat tests so that they won't accidentally hang. 2013-05-16 15:21:53 +02:00
Charles-François Natali adbfcb83a2 test_asyncore: wait explicitly for a thread termination (this dangling thread
could be the cause of a random failure).
2013-01-13 14:12:35 +01:00
Charles-François Natali 1ea12ff04d test_asyncore: wait explicitly for a thread termination (this dangling thread
could be the cause of a random failure).
2013-01-13 14:08:01 +01:00
Charles-François Natali ce1519d250 test_asyncore: wait explicitly for a thread termination (this dangling thread
could be the cause of a random failure).
2013-01-13 13:56:52 +01:00
Ezio Melotti af5b688f71 #16896: merge with 3.3. 2013-01-10 05:29:33 +02:00
Ezio Melotti 47236db1d0 #16896: test_asyncore now works with unittest test discovery. Patch by Zachary Ware. 2013-01-10 05:28:52 +02:00
Andrew Svetlov 0832af6628 Issue #16717: get rid of socket.error, replace with OSError 2012-12-18 23:10:48 +02:00
Kristján Valur Jónsson b2e58185e5 Set a time threshold in test_asyncore.capture_server so that tests don't
deadlock if the main thread fails before sending all the data.
2012-04-06 14:37:45 +00:00
Giampaolo Rodola' c7ea19fee8 attempt to fix asyncore buildbot failure 2012-03-23 15:09:58 +01:00
Giampaolo Rodola' a3481e70d1 attempt to fix asyncore buildbot failure 2012-03-23 15:07:07 +01:00
Giampaolo Rodola' 466a54f4dc fix failing asyncore test as per http://bugs.python.org/issue10340#msg156586 2012-03-23 13:29:01 +01:00
Giampaolo Rodola' 3539ef3d21 merge 79422b3684f1 in 3.3 branch (issue 10340) 2012-03-22 16:19:45 +01:00
Giampaolo Rodola' 350c94b900 fix #10340: properly handle EINVAL on OSX and also avoid to call handle_connect() in case of a disconnetected socket which is not meant to connect. 2012-03-22 16:17:43 +01:00
Charles-François Natali cf85c300cf test_asyncore: Actually try to received OOB data. 2011-11-02 20:30:59 +01:00
Charles-François Natali 39648d11ab test_asyncore: Enable tests of Unix domain sockets with poll(). 2011-10-31 12:08:09 +01:00
Charles-François Natali fea6cb0285 Issue #5661: on EPIPE/ECONNRESET, OS X returns the FD with the POLLPRI flag... 2011-10-29 14:29:39 +02:00
Charles-François Natali d4621190c9 Issue #5661: Add a test for ECONNRESET/EPIPE handling to test_asyncore. Patch
by Xavier de Gaye.
2011-10-29 12:45:56 +02:00
Charles-François Natali a045c05878 Issue #12656: Really fix test_asyncore failures on Windows buildbots... 2011-08-25 01:22:50 +02:00
Charles-François Natali e3540b47d1 Issue #12656: Fix test_asyncore failures on Windows buildbots. 2011-08-25 00:50:41 +02:00
Charles-François Natali e78cbecaf1 Issue #12656: Add tests for IPv6 and Unix sockets to test_asyncore. 2011-08-24 23:24:05 +02:00
Giampaolo Rodolà 103a6d6cd6 Issue 11177: asyncore's create_socket() arguments can now be omitted. 2011-02-25 22:21:22 +00:00
Giampaolo Rodolà 31c44031f8 Merged revisions 88604 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88604 | giampaolo.rodola | 2011-02-25 21:05:48 +0100 (ven, 25 feb 2011) | 1 line

  (issue 11214) - fix asyncore.strerror test failure on AIX
........
2011-02-25 20:07:25 +00:00
Giampaolo Rodolà d2751fb482 (issue 11214) - fix asyncore.strerror test failure on AIX 2011-02-25 20:05:48 +00:00
Ezio Melotti ed3a7d2d60 #10273: Rename assertRegexpMatches and assertRaisesRegexp to assertRegex and assertRaisesRegex. 2010-12-01 02:32:32 +00:00
Benjamin Peterson d6868b4ed4 fix leaking sockets 2010-10-31 17:34:34 +00:00
Brett Cannon 2d562f8081 have test_asyncore properly close files. 2010-10-29 22:40:44 +00:00
Antoine Pitrou b1c5496738 Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module,
where supported by the system.  Patch by Nikita Vetoshkin.
2010-10-14 15:05:38 +00:00
Giampaolo Rodolà 977c707b42 Fix issue 6706: adds new handle_accepted() method to asyncore.dispatcher 2010-10-04 21:08:36 +00:00
Georg Brandl cbb0ae4a42 #9354: Provide getsockopt() in asyncore file_wrapper(). Patch by Lukas Langa. 2010-07-28 08:19:35 +00:00
Ezio Melotti 9a381c7a02 With skipUnless there is no need to add test classes conditionally. 2010-07-27 22:24:13 +00:00
Ezio Melotti 63c4640327 Use proper skips and assert* methods in test_asyncore. 2010-07-27 22:03:33 +00:00
Giampaolo Rodolà 82e02b5876 Merged revisions 81294 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81294 | giampaolo.rodola | 2010-05-18 22:04:31 +0200 (mar, 18 mag 2010) | 1 line

  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:11:58 +00:00
Giampaolo Rodolà 340d7d2cc3 Merged revisions 81102 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81102 | giampaolo.rodola | 2010-05-12 02:29:27 +0200 (mer, 12 mag 2010) | 1 line

  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:33:15 +00:00
Giampaolo Rodolà 8fc1178cf8 Merged revisions 81043 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81043 | giampaolo.rodola | 2010-05-10 17:33:22 +0200 (lun, 10 mag 2010) | 1 line

  Issue #8490: adds a more solid test suite for asyncore
........
2010-05-10 15:40:49 +00:00
Giampaolo Rodolà 8d2dc85154 Merged revisions 80875 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80875 | giampaolo.rodola | 2010-05-06 19:57:06 +0200 (gio, 06 mag 2010) | 1 line

  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 18:06:30 +00:00
Victor Stinner 45df820591 Merged revisions 80552-80556,80564-80566,80568-80571 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80552 | victor.stinner | 2010-04-27 23:46:03 +0200 (mar., 27 avril 2010) | 3 lines

  Issue #7449, part 1: fix test_support.py for Python compiled without thread
........
  r80553 | victor.stinner | 2010-04-27 23:47:01 +0200 (mar., 27 avril 2010) | 1 line

  Issue #7449, part 2: regrtest.py -j option requires thread support
........
  r80554 | victor.stinner | 2010-04-27 23:51:26 +0200 (mar., 27 avril 2010) | 9 lines

  Issue #7449 part 3, test_doctest: import trace module in test_coverage()

  Import trace module fail if the threading module is missing. test_coverage() is
  only used if test_doctest.py is used with the -c option. This commit allows to
  execute the test suite without thread support.

  Move "import trace" in test_coverage() and use
  test_support.import_module('trace').
........
  r80555 | victor.stinner | 2010-04-27 23:56:26 +0200 (mar., 27 avril 2010) | 6 lines

  Issue #7449, part 4: skip test_multiprocessing if thread support is disabled

  import threading after _multiprocessing to raise a more revelant error message:
  "No module named _multiprocessing". _multiprocessing is not compiled without
  thread support.
........
  r80556 | victor.stinner | 2010-04-28 00:01:24 +0200 (mer., 28 avril 2010) | 8 lines

  Issue #7449, part 5: split Test.test_open() of ctypes/test/test_errno.py

   * Split Test.test_open() in 2 functions: test_open() and test_thread_open()
   * Skip test_open() and test_thread_open() if we are unable to find the C
     library
   * Skip test_thread_open() if thread support is disabled
   * Use unittest.skipUnless(os.name == "nt", ...) on test_GetLastError()
........
  r80564 | victor.stinner | 2010-04-28 00:59:35 +0200 (mer., 28 avril 2010) | 4 lines

  Issue #7449, part 6: fix test_hashlib for missing threading module

  Move @test_support.reap_thread decorator from test_main() to test_threaded_hashing().
........
  r80565 | victor.stinner | 2010-04-28 01:01:29 +0200 (mer., 28 avril 2010) | 6 lines

  Issue #7449, part 7: simplify threading detection in test_capi

   * Skip TestPendingCalls if threading module is missing
   * Test if threading module is present or not, instead of test the presence of
     _testcapi._test_thread_state
........
  r80566 | victor.stinner | 2010-04-28 01:03:16 +0200 (mer., 28 avril 2010) | 4 lines

  Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing

  TestFifo can be executed without the threading module
........
  r80568 | victor.stinner | 2010-04-28 01:14:58 +0200 (mer., 28 avril 2010) | 6 lines

  Issue #7449, part 9: fix test_xmlrpclib for missing threading module

   * Skip testcases using threads if threading module is missing
   * Use "http://" instead of URL in ServerProxyTestCase if threading is missing
     because URL is not set in this case
........
  r80569 | victor.stinner | 2010-04-28 01:33:58 +0200 (mer., 28 avril 2010) | 6 lines

  Partial revert of r80556 (Issue #7449, part 5, fix ctypes test)

  Rewrite r80556: the thread test have to be executed just after the test on
  libc_open() and so the test cannot be splitted in two functions (without
  duplicating code, and I don't want to duplicate code).
........
  r80570 | victor.stinner | 2010-04-28 01:51:16 +0200 (mer., 28 avril 2010) | 8 lines

  Issue #7449, part 10: test_cmd imports trace module using test_support.import_module()

  Use test_support.import_module() instead of import to raise a SkipTest
  exception if the import fail. Import trace fails if the threading module is
  missing.

  See also part 3: test_doctest: import trace module in test_coverage().
........
  r80571 | victor.stinner | 2010-04-28 01:55:59 +0200 (mer., 28 avril 2010) | 6 lines

  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-28 22:31:17 +00:00
Antoine Pitrou 5ed353c293 Merged revisions 75826 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75826 | antoine.pitrou | 2009-10-27 19:36:47 +0100 (mar., 27 oct. 2009) | 3 lines

  Suppress transient refleaks in test_asyncore
........
2009-10-27 18:49:23 +00:00
R. David Murray 847f30e2bc Merged revisions 71553 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71553 | r.david.murray | 2009-04-12 21:06:46 -0400 (Sun, 12 Apr 2009) | 3 lines

  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:22:04 +00:00
R. David Murray 78532baeab Merged revisions 70873,70904,70934,71490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70873 | josiah.carlson | 2009-03-31 15:32:34 -0400 (Tue, 31 Mar 2009) | 2 lines

  This resolves issue 1161031.  Tests pass.
........
  r70904 | josiah.carlson | 2009-03-31 17:49:36 -0400 (Tue, 31 Mar 2009) | 3 lines

  Made handle_expt_event() be called last, so that we don't accidentally read
  after closing the socket.
........
  r70934 | josiah.carlson | 2009-03-31 21:28:11 -0400 (Tue, 31 Mar 2009) | 2 lines

  Fix for failing asyncore tests.
........
  r71490 | r.david.murray | 2009-04-11 13:52:56 -0400 (Sat, 11 Apr 2009) | 4 lines

  Make test_asyncore tests match code changes introduced by the
  fix to Issue1161031, refactoring the test to simplify it in
  the process.
........
2009-04-12 15:35:44 +00:00
Antoine Pitrou 9cadb1b6e0 Issue #3782: os.write() must not accept unicode strings 2008-09-15 23:02:56 +00:00
Hirokazu Yamamoto 7aa42ea1bb Merged revisions 66162 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r66162 | hirokazu.yamamoto | 2008-09-03 05:36:44 +0900 | 2 lines

  Issue #3759: test_asyncore.py leaked handle.
  Reviewed by Amaury Forgeot d'Arc
........
2008-09-02 20:41:25 +00:00
Josiah Carlson 91823c74cc Fixed test for asyncore. 2008-07-11 23:26:37 +00:00
Josiah Carlson 9f2f83338f Fixed bugs 760475, 953599, and 1519. This is a translation of changelist 64768
to the py3k branch.
2008-07-07 05:04:12 +00:00
Josiah Carlson d74900ebb5 Committing Py3k version of changelist 64080 and 64257, along with updated tests
for smtpd, which required updating with the new semantics.
2008-07-07 04:15:08 +00:00
Benjamin Peterson ee8712cda4 #2621 rename test.test_support to test.support 2008-05-20 21:35:26 +00:00