Skip to content

Commit

Permalink
disable telemetry on test suite runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibola committed Jan 7, 2025
1 parent 792a59b commit 193607d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions django_mongodb/base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import contextlib
from importlib import metadata
import os

from django.core.exceptions import ImproperlyConfigured
from django.db.backends.base.base import BaseDatabaseWrapper
from pymongo.collection import Collection
from pymongo.driver_info import DriverInfo
from pymongo.mongo_client import MongoClient

from . import __version__ as django_mongodb_backend_version
from . import dbapi as Database
from .client import DatabaseClient
from .creation import DatabaseCreation
Expand Down Expand Up @@ -175,7 +176,9 @@ def get_new_connection(self, conn_params):
return MongoClient(**conn_params, driver=self._driver_info())

def _driver_info(self):
return DriverInfo("django-mongodb", metadata.version("django-mongodb"))
if not os.environ.get("RUNNING_DJANGOS_TEST_SUITE"):
return DriverInfo("django-mongodb-backend", django_mongodb_backend_version)
return None

def _commit(self):
pass
Expand Down

0 comments on commit 193607d

Please sign in to comment.