33from doctest import DocTestSuite
44from test import support
55import weakref
6- import gc
6+ # import gc
77
88# Modules under test
99import _thread
@@ -36,7 +36,7 @@ def _local_refs(self, n):
3636 t .join ()
3737 del t
3838
39- gc .collect ()
39+ # gc.collect()
4040 self .assertEqual (len (weaklist ), n )
4141
4242 # XXX _threading_local keeps the local of the last stopped thread alive.
@@ -45,7 +45,7 @@ def _local_refs(self, n):
4545
4646 # Assignment to the same thread local frees it sometimes (!)
4747 local .someothervar = None
48- gc .collect ()
48+ # gc.collect()
4949 deadlist = [weak for weak in weaklist if weak () is None ]
5050 self .assertIn (len (deadlist ), (n - 1 , n ), (n , len (deadlist )))
5151
@@ -88,7 +88,7 @@ def f():
8888 # 2) GC the cycle (triggers threadmodule.c::local_clear
8989 # before local_dealloc)
9090 del cycle
91- gc .collect ()
91+ # gc.collect()
9292 e1 .set ()
9393 e2 .wait ()
9494
@@ -108,6 +108,8 @@ def f():
108108
109109 self .assertTrue (passed )
110110
111+ # TODO: RUSTPYTHON, __new__ vs __init__ cooperation
112+ @unittest .expectedFailure
111113 def test_arguments (self ):
112114 # Issue 1522237
113115 class MyLocal (self ._local ):
@@ -180,6 +182,8 @@ class LocalSubclass(self._local):
180182 """To test that subclasses behave properly."""
181183 self ._test_dict_attribute (LocalSubclass )
182184
185+ # TODO: RUSTPYTHON, cycle detection/collection
186+ @unittest .expectedFailure
183187 def test_cycle_collection (self ):
184188 class X :
185189 pass
@@ -189,7 +193,7 @@ class X:
189193 x .local .x = x
190194 wr = weakref .ref (x )
191195 del x
192- gc .collect ()
196+ # gc.collect()
193197 self .assertIsNone (wr ())
194198
195199
@@ -204,7 +208,7 @@ def test_main():
204208 suite = unittest .TestSuite ()
205209 suite .addTest (DocTestSuite ('_threading_local' ))
206210 suite .addTest (unittest .makeSuite (ThreadLocalTest ))
207- suite .addTest (unittest .makeSuite (PyThreadingLocalTest ))
211+ # suite.addTest(unittest.makeSuite(PyThreadingLocalTest))
208212
209213 local_orig = _threading_local .local
210214 def setUp (test ):
0 commit comments