Skip to content

Commit

Permalink
Fix pytest deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayak-mehta committed Jul 3, 2019
1 parent 78d8055 commit 8866eaa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@
def test_unknown_flavor():
message = ("Unknown flavor specified."
" Use either 'lattice' or 'stream'")
with pytest.raises(NotImplementedError, message=message):
with pytest.raises(NotImplementedError, match=message):
tables = camelot.read_pdf(filename, flavor='chocolate')


def test_input_kwargs():
message = "columns cannot be used with flavor='lattice'"
with pytest.raises(ValueError, message=message):
with pytest.raises(ValueError, match=message):
tables = camelot.read_pdf(filename, columns=['10,20,30,40'])


def test_unsupported_format():
message = 'File format not supported'
filename = os.path.join(testdir, 'foo.csv')
with pytest.raises(NotImplementedError, message=message):
with pytest.raises(NotImplementedError, match=message):
tables = camelot.read_pdf(filename)


def test_stream_equal_length():
message = ("Length of table_areas and columns"
" should be equal")
with pytest.raises(ValueError, message=message):
with pytest.raises(ValueError, match=message):
tables = camelot.read_pdf(filename, flavor='stream',
table_areas=['10,20,30,40'], columns=['10,20,30,40', '10,20,30,40'])

Expand Down Expand Up @@ -86,12 +86,12 @@ def test_no_tables_found_warnings_suppressed():
def test_no_password():
filename = os.path.join(testdir, 'health_protected.pdf')
message = 'file has not been decrypted'
with pytest.raises(Exception, message=message):
with pytest.raises(Exception, match=message):
tables = camelot.read_pdf(filename)


def test_bad_password():
filename = os.path.join(testdir, 'health_protected.pdf')
message = 'file has not been decrypted'
with pytest.raises(Exception, message=message):
with pytest.raises(Exception, match=message):
tables = camelot.read_pdf(filename, password='wrongpass')

0 comments on commit 8866eaa

Please sign in to comment.