diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-07 22:06:17 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-07 22:06:17 (GMT) |
commit | 783eea722bf6e7c9d679d5230cd327e68b4c55f7 (patch) | |
tree | 970d36cd9f167624de14643ad653ec5b1d65f841 /Lib/test/test_threading_local.py | |
parent | 2673c5bf5e9640bd2fbdc20c03dd7e95e39310e0 (diff) | |
download | cpython-783eea722bf6e7c9d679d5230cd327e68b4c55f7.zip cpython-783eea722bf6e7c9d679d5230cd327e68b4c55f7.tar.gz cpython-783eea722bf6e7c9d679d5230cd327e68b4c55f7.tar.bz2 |
Issue #9707: Rewritten reference implementation of threading.local which
is friendlier towards reference cycles. This change is not normally
visible since an optimized C implementation (_thread._local) is used
instead.
Diffstat (limited to 'Lib/test/test_threading_local.py')
-rw-r--r-- | Lib/test/test_threading_local.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py index acf37a0..c886a25 100644 --- a/Lib/test/test_threading_local.py +++ b/Lib/test/test_threading_local.py @@ -184,11 +184,6 @@ class BaseLocalTest: """To test that subclasses behave properly.""" self._test_dict_attribute(LocalSubclass) - -class ThreadLocalTest(unittest.TestCase, BaseLocalTest): - _local = _thread._local - - # Fails for the pure Python implementation def test_cycle_collection(self): class X: pass @@ -201,6 +196,10 @@ class ThreadLocalTest(unittest.TestCase, BaseLocalTest): gc.collect() self.assertIs(wr(), None) + +class ThreadLocalTest(unittest.TestCase, BaseLocalTest): + _local = _thread._local + class PyThreadingLocalTest(unittest.TestCase, BaseLocalTest): _local = _threading_local.local |