Skip to content
Merged
Show file tree
Hide file tree
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
More specific tests.
  • Loading branch information
serhiy-storchaka committed Jun 21, 2021
commit 62370db066a3e1700ae3d8e4ba93e72e93d95ffb
8 changes: 4 additions & 4 deletions Lib/test/test_contextlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,11 +672,11 @@ def __enter__(self):
pass

with self.exit_stack() as stack:
with self.assertRaisesRegex(TypeError, 'context manager'):
with self.assertRaisesRegex(TypeError, 'the context manager'):
stack.enter_context(LacksEnterAndExit())
with self.assertRaisesRegex(TypeError, 'context manager'):
with self.assertRaisesRegex(TypeError, 'the context manager'):
stack.enter_context(LacksEnter())
with self.assertRaisesRegex(TypeError, 'context manager'):
with self.assertRaisesRegex(TypeError, 'the context manager'):
stack.enter_context(LacksExit())
self.assertFalse(stack._exit_callbacks)

Expand Down Expand Up @@ -908,7 +908,7 @@ class Example(object): pass
cm.__enter__ = object()
cm.__exit__ = object()
stack = self.exit_stack()
with self.assertRaisesRegex(TypeError, "context manager"):
with self.assertRaisesRegex(TypeError, 'the context manager'):
stack.enter_context(cm)
stack.push(cm)
self.assertIs(stack._exit_callbacks[-1][1], cm)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_contextlib_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ class Example(object): pass
cm.__aenter__ = object()
cm.__aexit__ = object()
stack = self.exit_stack()
with self.assertRaisesRegex(TypeError, "asynchronous context manager"):
with self.assertRaisesRegex(TypeError, 'asynchronous context manager'):
await stack.enter_async_context(cm)
stack.push_async_exit(cm)
self.assertIs(stack._exit_callbacks[-1][1], cm)
Expand Down