Add f-strings and remove python3.5 test job
This commit is contained in:
+9
-5
@@ -114,31 +114,35 @@ def test_cli_password():
|
||||
def test_cli_output_format():
|
||||
with TemporaryDirectory() as tempdir:
|
||||
infile = os.path.join(testdir, "health.pdf")
|
||||
outfile = os.path.join(tempdir, "health.{}")
|
||||
|
||||
runner = CliRunner()
|
||||
|
||||
# json
|
||||
outfile = os.path.join(tempdir, "health.json")
|
||||
result = runner.invoke(
|
||||
cli,
|
||||
["--format", "json", "--output", outfile.format("json"), "stream", infile],
|
||||
["--format", "json", "--output", outfile, "stream", infile],
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
|
||||
# excel
|
||||
outfile = os.path.join(tempdir, "health.xlsx")
|
||||
result = runner.invoke(
|
||||
cli,
|
||||
["--format", "excel", "--output", outfile.format("xlsx"), "stream", infile],
|
||||
["--format", "excel", "--output", outfile, "stream", infile],
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
|
||||
# html
|
||||
outfile = os.path.join(tempdir, "health.html")
|
||||
result = runner.invoke(
|
||||
cli,
|
||||
["--format", "html", "--output", outfile.format("html"), "stream", infile],
|
||||
["--format", "html", "--output", outfile, "stream", infile],
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
|
||||
# zip
|
||||
outfile = os.path.join(tempdir, "health.csv")
|
||||
result = runner.invoke(
|
||||
cli,
|
||||
[
|
||||
@@ -146,7 +150,7 @@ def test_cli_output_format():
|
||||
"--format",
|
||||
"csv",
|
||||
"--output",
|
||||
outfile.format("csv"),
|
||||
outfile,
|
||||
"stream",
|
||||
infile,
|
||||
],
|
||||
|
||||
@@ -73,7 +73,7 @@ def test_no_tables_found_logs_suppressed():
|
||||
tables = camelot.read_pdf(filename, suppress_stdout=True)
|
||||
except Warning as e:
|
||||
warning_text = str(e)
|
||||
pytest.fail("Unexpected warning: {}".format(warning_text))
|
||||
pytest.fail(f"Unexpected warning: {warning_text}")
|
||||
|
||||
|
||||
def test_no_tables_found_warnings_suppressed():
|
||||
@@ -85,7 +85,7 @@ def test_no_tables_found_warnings_suppressed():
|
||||
tables = camelot.read_pdf(filename, suppress_stdout=True)
|
||||
except Warning as e:
|
||||
warning_text = str(e)
|
||||
pytest.fail("Unexpected warning: {}".format(warning_text))
|
||||
pytest.fail(f"Unexpected warning: {warning_text}"
|
||||
|
||||
|
||||
def test_no_password():
|
||||
|
||||
Reference in New Issue
Block a user