Skip to content

Commit 9fa6761

Browse files
test(pyramid): Support alpha suffixes in version parsing
1 parent a04ba6e commit 9fa6761

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/integrations/pyramid/test_pyramid.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytest
77
from pyramid.authorization import ACLAuthorizationPolicy
88
from pyramid.response import Response
9+
from packaging.version import Version
910
from werkzeug.test import Client
1011

1112
from sentry_sdk import capture_message, add_breadcrumb
@@ -18,7 +19,7 @@
1819
try:
1920
from importlib.metadata import version
2021

21-
PYRAMID_VERSION = tuple(map(int, version("pyramid").split(".")))
22+
PYRAMID_VERSION = Version(version("pyramid"))
2223

2324
except ImportError:
2425
# < py3.8
@@ -311,7 +312,7 @@ def errorhandler(exc, request):
311312

312313

313314
@pytest.mark.skipif(
314-
PYRAMID_VERSION < (1, 9),
315+
PYRAMID_VERSION < Version("1.9"),
315316
reason="We don't have the right hooks in older Pyramid versions",
316317
)
317318
def test_errorhandler_500(

0 commit comments

Comments
 (0)