@@ -23,6 +23,8 @@ def wrapper(*args, **kwargs):
23
23
24
24
25
25
class ContextTest (unittest .TestCase ):
26
+ # TODO: RUSTPYTHON
27
+ @unittest .expectedFailure
26
28
def test_context_var_new_1 (self ):
27
29
with self .assertRaisesRegex (TypeError , 'takes exactly 1' ):
28
30
contextvars .ContextVar ()
@@ -38,6 +40,8 @@ def test_context_var_new_1(self):
38
40
39
41
self .assertNotEqual (hash (c ), hash ('aaa' ))
40
42
43
+ # TODO: RUSTPYTHON
44
+ @unittest .expectedFailure
41
45
@isolated_context
42
46
def test_context_var_repr_1 (self ):
43
47
c = contextvars .ContextVar ('a' )
@@ -72,6 +76,8 @@ class MyContext(contextvars.Context):
72
76
class MyToken (contextvars .Token ):
73
77
pass
74
78
79
+ # TODO: RUSTPYTHON
80
+ @unittest .expectedFailure
75
81
def test_context_new_1 (self ):
76
82
with self .assertRaisesRegex (TypeError , 'any arguments' ):
77
83
contextvars .Context (1 )
@@ -81,6 +87,8 @@ def test_context_new_1(self):
81
87
contextvars .Context (a = 1 )
82
88
contextvars .Context (** {})
83
89
90
+ # TODO: RUSTPYTHON
91
+ @unittest .expectedFailure
84
92
def test_context_typerrors_1 (self ):
85
93
ctx = contextvars .Context ()
86
94
@@ -91,16 +99,22 @@ def test_context_typerrors_1(self):
91
99
with self .assertRaisesRegex (TypeError , 'ContextVar key was expected' ):
92
100
ctx .get (1 )
93
101
102
+ # TODO: RUSTPYTHON
103
+ @unittest .expectedFailure
94
104
def test_context_get_context_1 (self ):
95
105
ctx = contextvars .copy_context ()
96
106
self .assertIsInstance (ctx , contextvars .Context )
97
107
108
+ # TODO: RUSTPYTHON
109
+ @unittest .expectedFailure
98
110
def test_context_run_1 (self ):
99
111
ctx = contextvars .Context ()
100
112
101
113
with self .assertRaisesRegex (TypeError , 'missing 1 required' ):
102
114
ctx .run ()
103
115
116
+ # TODO: RUSTPYTHON
117
+ @unittest .expectedFailure
104
118
def test_context_run_2 (self ):
105
119
ctx = contextvars .Context ()
106
120
@@ -129,6 +143,8 @@ def func(*args, **kwargs):
129
143
((11 , 'bar' ), {'spam' : 'foo' }))
130
144
self .assertEqual (a , {})
131
145
146
+ # TODO: RUSTPYTHON
147
+ @unittest .expectedFailure
132
148
def test_context_run_3 (self ):
133
149
ctx = contextvars .Context ()
134
150
@@ -142,6 +158,8 @@ def func(*args, **kwargs):
142
158
with self .assertRaises (ZeroDivisionError ):
143
159
ctx .run (func , 1 , 2 , a = 123 )
144
160
161
+ # TODO: RUSTPYTHON
162
+ @unittest .expectedFailure
145
163
@isolated_context
146
164
def test_context_run_4 (self ):
147
165
ctx1 = contextvars .Context ()
@@ -167,6 +185,8 @@ def func1():
167
185
self .assertEqual (returned_ctx [var ], 'spam' )
168
186
self .assertIn (var , returned_ctx )
169
187
188
+ # TODO: RUSTPYTHON
189
+ @unittest .expectedFailure
170
190
def test_context_run_5 (self ):
171
191
ctx = contextvars .Context ()
172
192
var = contextvars .ContextVar ('var' )
@@ -181,6 +201,8 @@ def func():
181
201
182
202
self .assertIsNone (var .get (None ))
183
203
204
+ # TODO: RUSTPYTHON
205
+ @unittest .expectedFailure
184
206
def test_context_run_6 (self ):
185
207
ctx = contextvars .Context ()
186
208
c = contextvars .ContextVar ('a' , default = 0 )
@@ -195,6 +217,8 @@ def fun():
195
217
196
218
ctx .run (fun )
197
219
220
+ # TODO: RUSTPYTHON
221
+ @unittest .expectedFailure
198
222
def test_context_run_7 (self ):
199
223
ctx = contextvars .Context ()
200
224
@@ -204,6 +228,8 @@ def fun():
204
228
205
229
ctx .run (fun )
206
230
231
+ # TODO: RUSTPYTHON
232
+ @unittest .expectedFailure
207
233
@isolated_context
208
234
def test_context_getset_1 (self ):
209
235
c = contextvars .ContextVar ('c' )
@@ -258,6 +284,8 @@ def test_context_getset_1(self):
258
284
self .assertEqual (len (ctx2 ), 0 )
259
285
self .assertEqual (list (ctx2 ), [])
260
286
287
+ # TODO: RUSTPYTHON
288
+ @unittest .expectedFailure
261
289
@isolated_context
262
290
def test_context_getset_2 (self ):
263
291
v1 = contextvars .ContextVar ('v1' )
@@ -267,6 +295,8 @@ def test_context_getset_2(self):
267
295
with self .assertRaisesRegex (ValueError , 'by a different' ):
268
296
v2 .reset (t1 )
269
297
298
+ # TODO: RUSTPYTHON
299
+ @unittest .expectedFailure
270
300
@isolated_context
271
301
def test_context_getset_3 (self ):
272
302
c = contextvars .ContextVar ('c' , default = 42 )
@@ -292,6 +322,8 @@ def fun():
292
322
293
323
ctx .run (fun )
294
324
325
+ # TODO: RUSTPYTHON
326
+ @unittest .expectedFailure
295
327
@isolated_context
296
328
def test_context_getset_4 (self ):
297
329
c = contextvars .ContextVar ('c' , default = 42 )
@@ -302,6 +334,8 @@ def test_context_getset_4(self):
302
334
with self .assertRaisesRegex (ValueError , 'different Context' ):
303
335
c .reset (tok )
304
336
337
+ # TODO: RUSTPYTHON
338
+ @unittest .expectedFailure
305
339
@isolated_context
306
340
def test_context_getset_5 (self ):
307
341
c = contextvars .ContextVar ('c' , default = 42 )
@@ -315,6 +349,8 @@ def fun():
315
349
contextvars .copy_context ().run (fun )
316
350
self .assertEqual (c .get (), [])
317
351
352
+ # TODO: RUSTPYTHON
353
+ @unittest .expectedFailure
318
354
def test_context_copy_1 (self ):
319
355
ctx1 = contextvars .Context ()
320
356
c = contextvars .ContextVar ('c' , default = 42 )
@@ -340,6 +376,8 @@ def ctx2_fun():
340
376
341
377
ctx1 .run (ctx1_fun )
342
378
379
+ # TODO: RUSTPYTHON
380
+ @unittest .expectedFailure
343
381
@isolated_context
344
382
def test_context_threads_1 (self ):
345
383
cvar = contextvars .ContextVar ('cvar' )
@@ -358,6 +396,8 @@ def sub(num):
358
396
tp .shutdown ()
359
397
self .assertEqual (results , list (range (10 )))
360
398
399
+ # TODO: RUSTPYTHON
400
+ @unittest .expectedFailure
361
401
def test_contextvar_getitem (self ):
362
402
clss = contextvars .ContextVar
363
403
self .assertEqual (clss [str ], clss )
0 commit comments