mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-31 22:23:12 +08:00
17 lines
511 B
Python
17 lines
511 B
Python
import os
|
|
import django
|
|
from django.conf import settings
|
|
|
|
# We manually designate which settings we will be using in an environment variable
|
|
# This is similar to what occurs in the `manage.py`
|
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.contrib.djangorestframework.app.settings')
|
|
|
|
|
|
# `pytest` automatically calls this function once when tests are run.
|
|
def pytest_configure():
|
|
settings.DEBUG = False
|
|
if django.VERSION < (1, 7, 0):
|
|
settings.configure()
|
|
else:
|
|
django.setup()
|