summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/testmock/testasync.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/test/testmock/testasync.py')
-rw-r--r--Lib/unittest/test/testmock/testasync.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/unittest/test/testmock/testasync.py b/Lib/unittest/test/testmock/testasync.py
index df260ab..b7c5d6d 100644
--- a/Lib/unittest/test/testmock/testasync.py
+++ b/Lib/unittest/test/testmock/testasync.py
@@ -427,9 +427,10 @@ class AsyncArguments(IsolatedAsyncioTestCase):
self.assertEqual(output, 10)
async def test_add_side_effect_exception(self):
+ class CustomError(Exception): pass
async def addition(var): pass
- mock = AsyncMock(addition, side_effect=Exception('err'))
- with self.assertRaises(Exception):
+ mock = AsyncMock(addition, side_effect=CustomError('side-effect'))
+ with self.assertRaisesRegex(CustomError, 'side-effect'):
await mock(5)
async def test_add_side_effect_coroutine(self):