]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[2.7] bpo-31234: Join threads explicitly in tests (#7406)
authorVictor Stinner <vstinner@redhat.com>
Mon, 4 Jun 2018 21:53:52 +0000 (23:53 +0200)
committerGitHub <noreply@github.com>
Mon, 4 Jun 2018 21:53:52 +0000 (23:53 +0200)
commit146351860a34b3cde387930a360e57391e7b99f3
tree3dfec92924fcd26696a0297cbf36e6bc593b5957
parentfadcd4458dca4e9edaa35e3becb4109042944b07
[2.7] bpo-31234: Join threads explicitly in tests (#7406)

* Add support.wait_threads_exit(): context manager looping at exit
  until the number of threads decreases to its original number.
* Add some missing thread.join()
* test_asyncore.test_send(): call explicitly t.join() because the cleanup
  function is only called outside the test method, whereas the method
  has a @test_support.reap_threads decorator
* test_hashlib: replace threading.Event with thread.join()
* test_thread:

  * Use wait_threads_exit() context manager
  * Replace test_support with support
  * test_forkinthread(): check child process exit status in the
    main thread to better handle error.
Lib/test/support/__init__.py
Lib/test/test_asyncore.py
Lib/test/test_hashlib.py
Lib/test/test_httpservers.py
Lib/test/test_smtplib.py
Lib/test/test_thread.py