Pillow/Tests/test_pyroma.py

25 lines
573 B
Python
Raw Normal View History

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")
2020-01-27 14:46:52 +03:00
def test_pyroma():
# 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, [])