]> granicus.if.org Git - python/commitdiff
Issue #14407: Fix unittest test discovery in test_concurrent_futures.
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 15 Oct 2013 21:24:44 +0000 (23:24 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 15 Oct 2013 21:24:44 +0000 (23:24 +0200)
1  2 
Lib/test/test_concurrent_futures.py
Misc/NEWS

index 4ad33091b0f1c66cd94b7b628ff2864ef9abcaa4,39230e1cf09631053a2903046be7e6e88db389e7..a7e945cb5e9d614be451c3f99018290f5b99793e
@@@ -402,24 -396,8 +402,24 @@@ class ExecutorTest
          self.executor.map(str, [2] * (self.worker_count + 1))
          self.executor.shutdown()
  
 +    @test.support.cpython_only
 +    def test_no_stale_references(self):
 +        # Issue #16284: check that the executors don't unnecessarily hang onto
 +        # references.
 +        my_object = MyObject()
 +        my_object_collected = threading.Event()
 +        my_object_callback = weakref.ref(
 +            my_object, lambda obj: my_object_collected.set())
 +        # Deliberately discarding the future.
 +        self.executor.submit(my_object.my_method)
 +        del my_object
 +
 +        collected = my_object_collected.wait(timeout=5.0)
 +        self.assertTrue(collected,
 +                        "Stale reference not collected within timeout.")
 +
  
- class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest):
+ class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest, unittest.TestCase):
      def test_map_submits_without_iteration(self):
          """Tests verifying issue 11777."""
          finished = []
diff --cc Misc/NEWS
index 88c9bc38c1b2e757f3049e130546a36b214cc87c,7744958e3027e663e22f75a58b4e83edda6676cf..e5d92cd4ca55c515d68fff3abf7de66b519acf09
+++ b/Misc/NEWS
@@@ -113,44 -117,6 +113,46 @@@ Librar
  - Issue #4366: Fix building extensions on all platforms when --enable-shared
    is used.
  
 +Tests
 +-----
 +
++- Issue #14407: Fix unittest test discovery in test_concurrent_futures.
++
 +- Issue #18919: Unified and extended tests for audio modules: aifc, sunau and
 +  wave.
 +
 +- Issue #18714: Added tests for ``pdb.find_function()``.
 +
 +Documentation
 +-------------
 +
 +- Issue #18758: Fixed and improved cross-references.
 +
 +- Issue #18972: Modernize email examples and use the argparse module in them.
 +
 +Build
 +-----
 +
 +- Issue #19130: Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
 +
 +
 +What's New in Python 3.4.0 Alpha 3?
 +===================================
 +
 +Release date: 2013-09-29
 +
 +
 +Core and Builtins
 +-----------------
 +
 +- Issue #18818: The "encodingname" part of PYTHONIOENCODING is now optional.
 +
 +- Issue #19098: Prevent overflow in the compiler when the recursion limit is set
 +  absurdly high.
 +
 +Library
 +-------
 +
  - Issue #18950: Fix miscellaneous bugs in the sunau module.
    Au_read.readframes() now updates current file position and reads correct
    number of frames from multichannel stream.  Au_write.writeframesraw() now