Skip to content

Commit 9b27d44

Browse files
authored
More pytest migrations (#393)
* More pytest migrations
1 parent b27f4d5 commit 9b27d44

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

django_prometheus/tests/end2end/testapp/test_migrations.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from unittest.mock import MagicMock
22

3-
from django.test import SimpleTestCase
3+
import pytest
44

55
from django_prometheus.migrations import ExportMigrationsForDatabase
66
from django_prometheus.testutils import assert_metric_equal
@@ -15,7 +15,8 @@ def M(metric_name):
1515
return "django_migrations_%s" % metric_name
1616

1717

18-
class TestMigrations(SimpleTestCase):
18+
@pytest.mark.django_db()
19+
class TestMigrations:
1920
"""Test migration counters."""
2021

2122
def test_counters(self):

django_prometheus/tests/end2end/testapp/test_models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.test import TestCase
1+
import pytest
22
from testapp.models import Dog, Lawn
33

44
from django_prometheus.testutils import assert_metric_diff, save_registry
@@ -13,7 +13,8 @@ def M(metric_name):
1313
return "django_model_%s" % metric_name
1414

1515

16-
class TestModelMetrics(TestCase):
16+
@pytest.mark.django_db()
17+
class TestModelMetrics:
1718
"""Test django_prometheus.models."""
1819

1920
def test_counters(self):

0 commit comments

Comments
 (0)