1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
from importlib import metadata
import pytest
import service_identity
class TestLegacyMetadataHack:
def test_version(self):
"""
service_identity.__version__ returns the correct version.
"""
assert (
metadata.version("service-identity")
== service_identity.__version__
)
def test_does_not_exist(self):
"""
Asking for unsupported dunders raises an AttributeError.
"""
with pytest.raises(
AttributeError,
match="module service_identity has no attribute __yolo__",
):
service_identity.__yolo__
|