mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Combined test_report.py into test_main.py
This commit is contained in:
parent
7e71621671
commit
1ac1540fe3
|
@ -7,11 +7,12 @@ import sys
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("report", (False, True))
|
@pytest.mark.parametrize(
|
||||||
def test_main(report) -> None:
|
"args, report",
|
||||||
args = [sys.executable, "-m", "PIL"]
|
((["PIL.report"], True), (["PIL", "--report"], True), (["PIL"], False)),
|
||||||
if report:
|
)
|
||||||
args.append("--report")
|
def test_main(args, report) -> None:
|
||||||
|
args = [sys.executable, "-m"] + args
|
||||||
out = subprocess.check_output(args).decode("utf-8")
|
out = subprocess.check_output(args).decode("utf-8")
|
||||||
lines = out.splitlines()
|
lines = out.splitlines()
|
||||||
assert lines[0] == "-" * 68
|
assert lines[0] == "-" * 68
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def test_main() -> None:
|
|
||||||
args = [sys.executable, "-m", "PIL.report"]
|
|
||||||
out = subprocess.check_output(args).decode("utf-8")
|
|
||||||
lines = out.splitlines()
|
|
||||||
assert lines[0] == "-" * 68
|
|
||||||
assert lines[1].startswith("Pillow ")
|
|
||||||
assert lines[2].startswith("Python ")
|
|
||||||
lines = lines[3:]
|
|
||||||
while lines[0].startswith(" "):
|
|
||||||
lines = lines[1:]
|
|
||||||
assert lines[0] == "-" * 68
|
|
||||||
assert lines[1].startswith("Python executable is")
|
|
||||||
lines = lines[2:]
|
|
||||||
if lines[0].startswith("Environment Python files loaded from"):
|
|
||||||
lines = lines[1:]
|
|
||||||
assert lines[0].startswith("System Python files loaded from")
|
|
||||||
assert lines[1] == "-" * 68
|
|
||||||
assert lines[2].startswith("Python Pillow modules loaded from ")
|
|
||||||
assert lines[3].startswith("Binary Pillow modules loaded from ")
|
|
||||||
assert lines[4] == "-" * 68
|
|
||||||
assert "JPEG image/jpeg" not in out
|
|
Loading…
Reference in New Issue
Block a user