10
10
from test .support import threading_helper
11
11
12
12
try :
13
- from _testcapi import hamt
13
+ from _testinternalcapi import hamt
14
14
except ImportError :
15
15
hamt = None
16
16
@@ -42,8 +42,6 @@ def test_context_var_new_1(self):
42
42
43
43
self .assertNotEqual (hash (c ), hash ('aaa' ))
44
44
45
- # TODO: RUSTPYTHON
46
- @unittest .expectedFailure
47
45
@isolated_context
48
46
def test_context_var_repr_1 (self ):
49
47
c = contextvars .ContextVar ('a' )
@@ -101,8 +99,6 @@ def test_context_typerrors_1(self):
101
99
with self .assertRaisesRegex (TypeError , 'ContextVar key was expected' ):
102
100
ctx .get (1 )
103
101
104
- # TODO: RUSTPYTHON
105
- @unittest .expectedFailure
106
102
def test_context_get_context_1 (self ):
107
103
ctx = contextvars .copy_context ()
108
104
self .assertIsInstance (ctx , contextvars .Context )
@@ -115,8 +111,6 @@ def test_context_run_1(self):
115
111
with self .assertRaisesRegex (TypeError , 'missing 1 required' ):
116
112
ctx .run ()
117
113
118
- # TODO: RUSTPYTHON
119
- @unittest .expectedFailure
120
114
def test_context_run_2 (self ):
121
115
ctx = contextvars .Context ()
122
116
@@ -145,8 +139,6 @@ def func(*args, **kwargs):
145
139
((11 , 'bar' ), {'spam' : 'foo' }))
146
140
self .assertEqual (a , {})
147
141
148
- # TODO: RUSTPYTHON
149
- @unittest .expectedFailure
150
142
def test_context_run_3 (self ):
151
143
ctx = contextvars .Context ()
152
144
@@ -187,8 +179,6 @@ def func1():
187
179
self .assertEqual (returned_ctx [var ], 'spam' )
188
180
self .assertIn (var , returned_ctx )
189
181
190
- # TODO: RUSTPYTHON
191
- @unittest .expectedFailure
192
182
def test_context_run_5 (self ):
193
183
ctx = contextvars .Context ()
194
184
var = contextvars .ContextVar ('var' )
@@ -203,8 +193,6 @@ def func():
203
193
204
194
self .assertIsNone (var .get (None ))
205
195
206
- # TODO: RUSTPYTHON
207
- @unittest .expectedFailure
208
196
def test_context_run_6 (self ):
209
197
ctx = contextvars .Context ()
210
198
c = contextvars .ContextVar ('a' , default = 0 )
@@ -219,8 +207,6 @@ def fun():
219
207
220
208
ctx .run (fun )
221
209
222
- # TODO: RUSTPYTHON
223
- @unittest .expectedFailure
224
210
def test_context_run_7 (self ):
225
211
ctx = contextvars .Context ()
226
212
@@ -286,8 +272,6 @@ def test_context_getset_1(self):
286
272
self .assertEqual (len (ctx2 ), 0 )
287
273
self .assertEqual (list (ctx2 ), [])
288
274
289
- # TODO: RUSTPYTHON
290
- @unittest .expectedFailure
291
275
@isolated_context
292
276
def test_context_getset_2 (self ):
293
277
v1 = contextvars .ContextVar ('v1' )
@@ -297,8 +281,6 @@ def test_context_getset_2(self):
297
281
with self .assertRaisesRegex (ValueError , 'by a different' ):
298
282
v2 .reset (t1 )
299
283
300
- # TODO: RUSTPYTHON
301
- @unittest .expectedFailure
302
284
@isolated_context
303
285
def test_context_getset_3 (self ):
304
286
c = contextvars .ContextVar ('c' , default = 42 )
@@ -324,8 +306,6 @@ def fun():
324
306
325
307
ctx .run (fun )
326
308
327
- # TODO: RUSTPYTHON
328
- @unittest .expectedFailure
329
309
@isolated_context
330
310
def test_context_getset_4 (self ):
331
311
c = contextvars .ContextVar ('c' , default = 42 )
@@ -378,8 +358,6 @@ def ctx2_fun():
378
358
379
359
ctx1 .run (ctx1_fun )
380
360
381
- # TODO: RUSTPYTHON
382
- @unittest .expectedFailure
383
361
@isolated_context
384
362
@threading_helper .requires_working_threading ()
385
363
def test_context_threads_1 (self ):
@@ -470,7 +448,7 @@ class EqError(Exception):
470
448
pass
471
449
472
450
473
- @unittest .skipIf (hamt is None , '_testcapi lacks " hamt()" function ' )
451
+ @unittest .skipIf (hamt is None , '_testinternalcapi. hamt() not available ' )
474
452
class HamtTest (unittest .TestCase ):
475
453
476
454
def test_hashkey_helper_1 (self ):
0 commit comments