1010from test .support import threading_helper
1111
1212try :
13- from _testcapi import hamt
13+ from _testinternalcapi import hamt
1414except ImportError :
1515 hamt = None
1616
@@ -42,8 +42,6 @@ def test_context_var_new_1(self):
4242
4343 self .assertNotEqual (hash (c ), hash ('aaa' ))
4444
45- # TODO: RUSTPYTHON
46- @unittest .expectedFailure
4745 @isolated_context
4846 def test_context_var_repr_1 (self ):
4947 c = contextvars .ContextVar ('a' )
@@ -101,8 +99,6 @@ def test_context_typerrors_1(self):
10199 with self .assertRaisesRegex (TypeError , 'ContextVar key was expected' ):
102100 ctx .get (1 )
103101
104- # TODO: RUSTPYTHON
105- @unittest .expectedFailure
106102 def test_context_get_context_1 (self ):
107103 ctx = contextvars .copy_context ()
108104 self .assertIsInstance (ctx , contextvars .Context )
@@ -115,8 +111,6 @@ def test_context_run_1(self):
115111 with self .assertRaisesRegex (TypeError , 'missing 1 required' ):
116112 ctx .run ()
117113
118- # TODO: RUSTPYTHON
119- @unittest .expectedFailure
120114 def test_context_run_2 (self ):
121115 ctx = contextvars .Context ()
122116
@@ -145,8 +139,6 @@ def func(*args, **kwargs):
145139 ((11 , 'bar' ), {'spam' : 'foo' }))
146140 self .assertEqual (a , {})
147141
148- # TODO: RUSTPYTHON
149- @unittest .expectedFailure
150142 def test_context_run_3 (self ):
151143 ctx = contextvars .Context ()
152144
@@ -187,8 +179,6 @@ def func1():
187179 self .assertEqual (returned_ctx [var ], 'spam' )
188180 self .assertIn (var , returned_ctx )
189181
190- # TODO: RUSTPYTHON
191- @unittest .expectedFailure
192182 def test_context_run_5 (self ):
193183 ctx = contextvars .Context ()
194184 var = contextvars .ContextVar ('var' )
@@ -203,8 +193,6 @@ def func():
203193
204194 self .assertIsNone (var .get (None ))
205195
206- # TODO: RUSTPYTHON
207- @unittest .expectedFailure
208196 def test_context_run_6 (self ):
209197 ctx = contextvars .Context ()
210198 c = contextvars .ContextVar ('a' , default = 0 )
@@ -219,8 +207,6 @@ def fun():
219207
220208 ctx .run (fun )
221209
222- # TODO: RUSTPYTHON
223- @unittest .expectedFailure
224210 def test_context_run_7 (self ):
225211 ctx = contextvars .Context ()
226212
@@ -286,8 +272,6 @@ def test_context_getset_1(self):
286272 self .assertEqual (len (ctx2 ), 0 )
287273 self .assertEqual (list (ctx2 ), [])
288274
289- # TODO: RUSTPYTHON
290- @unittest .expectedFailure
291275 @isolated_context
292276 def test_context_getset_2 (self ):
293277 v1 = contextvars .ContextVar ('v1' )
@@ -297,8 +281,6 @@ def test_context_getset_2(self):
297281 with self .assertRaisesRegex (ValueError , 'by a different' ):
298282 v2 .reset (t1 )
299283
300- # TODO: RUSTPYTHON
301- @unittest .expectedFailure
302284 @isolated_context
303285 def test_context_getset_3 (self ):
304286 c = contextvars .ContextVar ('c' , default = 42 )
@@ -324,8 +306,6 @@ def fun():
324306
325307 ctx .run (fun )
326308
327- # TODO: RUSTPYTHON
328- @unittest .expectedFailure
329309 @isolated_context
330310 def test_context_getset_4 (self ):
331311 c = contextvars .ContextVar ('c' , default = 42 )
@@ -378,8 +358,6 @@ def ctx2_fun():
378358
379359 ctx1 .run (ctx1_fun )
380360
381- # TODO: RUSTPYTHON
382- @unittest .expectedFailure
383361 @isolated_context
384362 @threading_helper .requires_working_threading ()
385363 def test_context_threads_1 (self ):
@@ -470,7 +448,7 @@ class EqError(Exception):
470448 pass
471449
472450
473- @unittest .skipIf (hamt is None , '_testcapi lacks " hamt()" function ' )
451+ @unittest .skipIf (hamt is None , '_testinternalcapi. hamt() not available ' )
474452class HamtTest (unittest .TestCase ):
475453
476454 def test_hashkey_helper_1 (self ):
0 commit comments