Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Mark failing/erroring tests
  • Loading branch information
fanninpm committed Jan 30, 2022
commit 1231bfb7560f83947c7ea3271406939ca7d338f7
40 changes: 40 additions & 0 deletions Lib/test/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def wrapper(*args, **kwargs):


class ContextTest(unittest.TestCase):
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_var_new_1(self):
with self.assertRaisesRegex(TypeError, 'takes exactly 1'):
contextvars.ContextVar()
Expand All @@ -38,6 +40,8 @@ def test_context_var_new_1(self):

self.assertNotEqual(hash(c), hash('aaa'))

# TODO: RUSTPYTHON
@unittest.expectedFailure
@isolated_context
def test_context_var_repr_1(self):
c = contextvars.ContextVar('a')
Expand Down Expand Up @@ -72,6 +76,8 @@ class MyContext(contextvars.Context):
class MyToken(contextvars.Token):
pass

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_new_1(self):
with self.assertRaisesRegex(TypeError, 'any arguments'):
contextvars.Context(1)
Expand All @@ -81,6 +87,8 @@ def test_context_new_1(self):
contextvars.Context(a=1)
contextvars.Context(**{})

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_typerrors_1(self):
ctx = contextvars.Context()

Expand All @@ -91,16 +99,22 @@ def test_context_typerrors_1(self):
with self.assertRaisesRegex(TypeError, 'ContextVar key was expected'):
ctx.get(1)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_get_context_1(self):
ctx = contextvars.copy_context()
self.assertIsInstance(ctx, contextvars.Context)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_run_1(self):
ctx = contextvars.Context()

with self.assertRaisesRegex(TypeError, 'missing 1 required'):
ctx.run()

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_run_2(self):
ctx = contextvars.Context()

Expand Down Expand Up @@ -129,6 +143,8 @@ def func(*args, **kwargs):
((11, 'bar'), {'spam': 'foo'}))
self.assertEqual(a, {})

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_run_3(self):
ctx = contextvars.Context()

Expand All @@ -142,6 +158,8 @@ def func(*args, **kwargs):
with self.assertRaises(ZeroDivisionError):
ctx.run(func, 1, 2, a=123)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@isolated_context
def test_context_run_4(self):
ctx1 = contextvars.Context()
Expand All @@ -167,6 +185,8 @@ def func1():
self.assertEqual(returned_ctx[var], 'spam')
self.assertIn(var, returned_ctx)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_run_5(self):
ctx = contextvars.Context()
var = contextvars.ContextVar('var')
Expand All @@ -181,6 +201,8 @@ def func():

self.assertIsNone(var.get(None))

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_run_6(self):
ctx = contextvars.Context()
c = contextvars.ContextVar('a', default=0)
Expand All @@ -195,6 +217,8 @@ def fun():

ctx.run(fun)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_run_7(self):
ctx = contextvars.Context()

Expand All @@ -204,6 +228,8 @@ def fun():

ctx.run(fun)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@isolated_context
def test_context_getset_1(self):
c = contextvars.ContextVar('c')
Expand Down Expand Up @@ -258,6 +284,8 @@ def test_context_getset_1(self):
self.assertEqual(len(ctx2), 0)
self.assertEqual(list(ctx2), [])

# TODO: RUSTPYTHON
@unittest.expectedFailure
@isolated_context
def test_context_getset_2(self):
v1 = contextvars.ContextVar('v1')
Expand All @@ -267,6 +295,8 @@ def test_context_getset_2(self):
with self.assertRaisesRegex(ValueError, 'by a different'):
v2.reset(t1)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@isolated_context
def test_context_getset_3(self):
c = contextvars.ContextVar('c', default=42)
Expand All @@ -292,6 +322,8 @@ def fun():

ctx.run(fun)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@isolated_context
def test_context_getset_4(self):
c = contextvars.ContextVar('c', default=42)
Expand All @@ -302,6 +334,8 @@ def test_context_getset_4(self):
with self.assertRaisesRegex(ValueError, 'different Context'):
c.reset(tok)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@isolated_context
def test_context_getset_5(self):
c = contextvars.ContextVar('c', default=42)
Expand All @@ -315,6 +349,8 @@ def fun():
contextvars.copy_context().run(fun)
self.assertEqual(c.get(), [])

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_context_copy_1(self):
ctx1 = contextvars.Context()
c = contextvars.ContextVar('c', default=42)
Expand All @@ -340,6 +376,8 @@ def ctx2_fun():

ctx1.run(ctx1_fun)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@isolated_context
def test_context_threads_1(self):
cvar = contextvars.ContextVar('cvar')
Expand All @@ -358,6 +396,8 @@ def sub(num):
tp.shutdown()
self.assertEqual(results, list(range(10)))

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_contextvar_getitem(self):
clss = contextvars.ContextVar
self.assertEqual(clss[str], clss)
Expand Down