Pillow/Tests/test_pyroma.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
618 B
Python
Raw Normal View History

from __future__ import annotations
2024-01-20 14:23:03 +03:00
2020-01-27 14:46:52 +03:00
import pytest
from PIL import __version__
2014-09-30 00:14:32 +04:00
pyroma = pytest.importorskip("pyroma", reason="Pyroma not installed")
2024-01-27 07:19:43 +03:00
def test_pyroma() -> None:
2020-01-27 14:46:52 +03:00
# Arrange
data = pyroma.projectdata.get_data(".")
2020-01-27 14:46:52 +03:00
# Act
rating = pyroma.ratings.rate(data)
2020-01-27 14:46:52 +03:00
# Assert
if "rc" in __version__:
# Pyroma needs to chill about RC versions and not kill all our tests.
assert rating == (
9,
["The package's version number does not comply with PEP-386."],
)
2014-09-30 00:14:32 +04:00
2020-01-27 14:46:52 +03:00
else:
# Should have a perfect score
assert rating == (10, [])