Merge pull request #2 from camelot-dev/fix-pytest-dep-warning
[MRG] Fix pytest deprecation warningpull/1/head
commit
27d55d056c
|
|
@ -16,27 +16,27 @@ filename = os.path.join(testdir, 'foo.pdf')
|
||||||
def test_unknown_flavor():
|
def test_unknown_flavor():
|
||||||
message = ("Unknown flavor specified."
|
message = ("Unknown flavor specified."
|
||||||
" Use either 'lattice' or 'stream'")
|
" Use either 'lattice' or 'stream'")
|
||||||
with pytest.raises(NotImplementedError, message=message):
|
with pytest.raises(NotImplementedError, match=message):
|
||||||
tables = camelot.read_pdf(filename, flavor='chocolate')
|
tables = camelot.read_pdf(filename, flavor='chocolate')
|
||||||
|
|
||||||
|
|
||||||
def test_input_kwargs():
|
def test_input_kwargs():
|
||||||
message = "columns cannot be used with flavor='lattice'"
|
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'])
|
tables = camelot.read_pdf(filename, columns=['10,20,30,40'])
|
||||||
|
|
||||||
|
|
||||||
def test_unsupported_format():
|
def test_unsupported_format():
|
||||||
message = 'File format not supported'
|
message = 'File format not supported'
|
||||||
filename = os.path.join(testdir, 'foo.csv')
|
filename = os.path.join(testdir, 'foo.csv')
|
||||||
with pytest.raises(NotImplementedError, message=message):
|
with pytest.raises(NotImplementedError, match=message):
|
||||||
tables = camelot.read_pdf(filename)
|
tables = camelot.read_pdf(filename)
|
||||||
|
|
||||||
|
|
||||||
def test_stream_equal_length():
|
def test_stream_equal_length():
|
||||||
message = ("Length of table_areas and columns"
|
message = ("Length of table_areas and columns"
|
||||||
" should be equal")
|
" should be equal")
|
||||||
with pytest.raises(ValueError, message=message):
|
with pytest.raises(ValueError, match=message):
|
||||||
tables = camelot.read_pdf(filename, flavor='stream',
|
tables = camelot.read_pdf(filename, flavor='stream',
|
||||||
table_areas=['10,20,30,40'], columns=['10,20,30,40', '10,20,30,40'])
|
table_areas=['10,20,30,40'], columns=['10,20,30,40', '10,20,30,40'])
|
||||||
|
|
||||||
|
|
@ -86,12 +86,12 @@ def test_no_tables_found_warnings_suppressed():
|
||||||
def test_no_password():
|
def test_no_password():
|
||||||
filename = os.path.join(testdir, 'health_protected.pdf')
|
filename = os.path.join(testdir, 'health_protected.pdf')
|
||||||
message = 'file has not been decrypted'
|
message = 'file has not been decrypted'
|
||||||
with pytest.raises(Exception, message=message):
|
with pytest.raises(Exception, match=message):
|
||||||
tables = camelot.read_pdf(filename)
|
tables = camelot.read_pdf(filename)
|
||||||
|
|
||||||
|
|
||||||
def test_bad_password():
|
def test_bad_password():
|
||||||
filename = os.path.join(testdir, 'health_protected.pdf')
|
filename = os.path.join(testdir, 'health_protected.pdf')
|
||||||
message = 'file has not been decrypted'
|
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')
|
tables = camelot.read_pdf(filename, password='wrongpass')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue