Skip to content

Commit

Permalink
Fix DeprecationWarning in tests
Browse files Browse the repository at this point in the history
assertRaisesRegexp is deprecated
  • Loading branch information
elprans committed Sep 8, 2017
1 parent eaf298b commit 3f9523c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def __fspath__(self):
)

async def test_copy_from_query_to_bad_output(self):
with self.assertRaisesRegexp(TypeError, 'output is expected to be'):
with self.assertRaisesRegex(TypeError, 'output is expected to be'):
await self.con.copy_from_query('''
SELECT
i, i * 10
Expand Down Expand Up @@ -512,7 +512,7 @@ def __aiter__(self):
async def __anext__(self):
raise RuntimeError('failure in source')

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

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

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

# Check that the protocol has recovered.
Expand Down

0 comments on commit 3f9523c

Please sign in to comment.