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
Mark failing tests of test_contextlib.py
  • Loading branch information
dalinaum committed Mar 7, 2023
commit 5d6a48b568440daf343a66a442419cc6b055033b
20 changes: 20 additions & 0 deletions Lib/test/test_contextlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def woohoo():
raise ZeroDivisionError()
self.assertEqual(state, [1, 42, 999])

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_contextmanager_traceback(self):
@contextmanager
def f():
Expand Down Expand Up @@ -543,6 +545,8 @@ def method(self, a, b, c=None):
self.assertEqual(test.b, 2)


# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_typo_enter(self):
class mycontext(ContextDecorator):
def __unter__(self):
Expand All @@ -555,6 +559,8 @@ def __exit__(self, *exc):
pass


# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_typo_exit(self):
class mycontext(ContextDecorator):
def __enter__(self):
Expand Down Expand Up @@ -722,6 +728,8 @@ def _exit():
result.append(2)
self.assertEqual(result, [1, 2, 3, 4])

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_enter_context_errors(self):
class LacksEnterAndExit:
pass
Expand Down Expand Up @@ -776,6 +784,8 @@ def test_exit_suppress(self):
stack.push(lambda *exc: True)
1/0

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_exit_exception_traceback(self):
# This test captures the current behavior of ExitStack so that we know
# if we ever unintendedly change it. It is not a statement of what the
Expand Down Expand Up @@ -889,6 +899,8 @@ def suppress_exc(*exc_details):
self.assertIsInstance(inner_exc, ValueError)
self.assertIsInstance(inner_exc.__context__, ZeroDivisionError)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_exit_exception_explicit_none_context(self):
# Ensure ExitStack chaining matches actual nested `with` statements
# regarding explicit __context__ = None.
Expand Down Expand Up @@ -1035,6 +1047,8 @@ def test_excessive_nesting(self):
for i in range(10000):
stack.callback(int)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_instance_bypass(self):
class Example(object): pass
cm = Example()
Expand Down Expand Up @@ -1220,6 +1234,8 @@ def make_relative_path(self, *parts):
*parts,
)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_simple(self):
old_cwd = os.getcwd()
>
Expand All @@ -1229,6 +1245,8 @@ def test_simple(self):
self.assertEqual(os.getcwd(), target)
self.assertEqual(os.getcwd(), old_cwd)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_reentrant(self):
old_cwd = os.getcwd()
target1 = self.make_relative_path('data')
Expand All @@ -1246,6 +1264,8 @@ def test_reentrant(self):
self.assertEqual(os.getcwd(), target1)
self.assertEqual(os.getcwd(), old_cwd)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_exception(self):
old_cwd = os.getcwd()
>
Expand Down