Skip to content

Commit d91a510

Browse files
authored
Use pid for test database name in Django tests (#2998)
* Using pid instead of random number
1 parent 534a301 commit d91a510

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/integrations/django/myapp/settings.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
https://docs.djangoproject.com/en/2.0/ref/settings/
1111
"""
1212

13-
import random
14-
1513
# We shouldn't access settings while setting up integrations. Initialize SDK
1614
# here to provoke any errors that might occur.
1715
import sentry_sdk
@@ -128,7 +126,7 @@ def middleware(request):
128126
"USER": os.environ.get("SENTRY_PYTHON_TEST_POSTGRES_USER", "postgres"),
129127
"PASSWORD": os.environ.get("SENTRY_PYTHON_TEST_POSTGRES_PASSWORD", "sentry"),
130128
"NAME": os.environ.get(
131-
"SENTRY_PYTHON_TEST_POSTGRES_NAME", f"myapp_db_{random.randint(0, 1000)}"
129+
"SENTRY_PYTHON_TEST_POSTGRES_NAME", f"myapp_db_{os.getpid()}"
132130
),
133131
}
134132
except (ImportError, KeyError):

0 commit comments

Comments
 (0)