Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit edf15b4

Browse files
committed
Improve Quiet cli test
1 parent 7ea668f commit edf15b4

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

camelot/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def read_pdf(
3636
flavor : str (default: 'lattice')
3737
The parsing method to use ('lattice' or 'stream').
3838
Lattice is used by default.
39-
suppress_stdout : bool, optional (default: True)
39+
suppress_stdout : bool, optional (default: False)
4040
Print all logs and warnings.
4141
parallel : bool, optional (default: False)
4242
Process pages in parallel using all available cpu cores.

tests/test_cli.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22

3+
import pytest
34
from click.testing import CliRunner
45

56
from camelot.cli import cli
@@ -232,10 +233,14 @@ def test_cli_quiet(testdir):
232233
)
233234
assert "Found 0 tables" in result.output
234235

235-
result = runner.invoke(
236-
cli, ["--quiet", "--format", "csv", "--output", outfile, "stream", infile]
237-
)
238-
assert "No tables found on page-1" not in result.output
236+
try:
237+
result = runner.invoke(
238+
cli,
239+
["--quiet", "--format", "csv", "--output", outfile, "stream", infile],
240+
)
241+
except Warning as e:
242+
warning_text = str(e)
243+
pytest.fail(f"Unexpected warning: {warning_text}")
239244

240245

241246
def test_cli_lattice_plot_type():

0 commit comments

Comments
 (0)