Skip to content

Commit

Permalink
add PIL.report
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Mar 9, 2024
1 parent e5a46ef commit a619a8d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Tests/test_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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
5 changes: 5 additions & 0 deletions src/PIL/report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from __future__ import annotations

from .features import pilinfo

pilinfo(supported_formats=False)

0 comments on commit a619a8d

Please sign in to comment.