Pillow/Tests/test_pyroma.py

29 lines
634 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
try:
import pyroma
except ImportError:
2018-10-21 17:47:35 +03:00
pyroma = None
2020-01-27 14:46:52 +03:00
@pytest.mark.skipif(pyroma is None, reason="Pyroma is not installed")
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, [])