Skip to content

Commit

Permalink
Update for new pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Dec 31, 2023
1 parent 3889e76 commit f54b552
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import django
from django.db import connection
from pytest_django.plugin import _blocking_manager
from pytest_django.plugin import blocking_manager_key


def pytest_report_header(config):
dot_version = ".".join(str(x) for x in django.VERSION)
header = "Django version: " + dot_version

with _blocking_manager.unblock(), connection._nodb_cursor() as cursor:
pytest_django_db_blocker = config.stash[blocking_manager_key]
with pytest_django_db_blocker.unblock(), connection._nodb_cursor() as cursor:
cursor.execute("SELECT VERSION()")
version = cursor.fetchone()[0]
header += f"\nMySQL version: {version}"
Expand Down

0 comments on commit f54b552

Please sign in to comment.