Skip to content

Commit 3f9523c

Browse files
committed
Fix DeprecationWarning in tests
assertRaisesRegexp is deprecated
1 parent eaf298b commit 3f9523c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_copy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def __fspath__(self):
217217
)
218218

219219
async def test_copy_from_query_to_bad_output(self):
220-
with self.assertRaisesRegexp(TypeError, 'output is expected to be'):
220+
with self.assertRaisesRegex(TypeError, 'output is expected to be'):
221221
await self.con.copy_from_query('''
222222
SELECT
223223
i, i * 10
@@ -512,7 +512,7 @@ def __aiter__(self):
512512
async def __anext__(self):
513513
raise RuntimeError('failure in source')
514514

515-
with self.assertRaisesRegexp(RuntimeError, 'failure in source'):
515+
with self.assertRaisesRegex(RuntimeError, 'failure in source'):
516516
await self.con.copy_to_table('copytab', source=_Source())
517517

518518
# Check that the protocol has recovered.
@@ -542,7 +542,7 @@ async def __anext__(self):
542542
else:
543543
raise RuntimeError('failure in source')
544544

545-
with self.assertRaisesRegexp(RuntimeError, 'failure in source'):
545+
with self.assertRaisesRegex(RuntimeError, 'failure in source'):
546546
await self.con.copy_to_table('copytab', source=_Source())
547547

548548
# Check that the protocol has recovered.

0 commit comments

Comments
 (0)