Skip to content

Commit f1a357a

Browse files
committed
fix: Do not crash CI on pypy
1 parent 7a34ffe commit f1a357a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/integrations/django/myapp/settings.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,14 @@ def process_response(self, request, response):
9595
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
9696

9797
try:
98+
import psycopg2 # noqa
99+
98100
DATABASES["postgres"] = {
99101
"ENGINE": "django.db.backends.postgresql_psycopg2",
100102
"NAME": os.environ["SENTRY_PYTHON_TEST_POSTGRES_NAME"],
101103
"USER": os.environ["SENTRY_PYTHON_TEST_POSTGRES_USER"],
102104
}
103-
except KeyError:
105+
except (ImportError, KeyError):
104106
pass
105107

106108

0 commit comments

Comments
 (0)