Skip to content

Commit 65e080f

Browse files
committed
Remove try/except/import for SimpleTestCase
1 parent ef83478 commit 65e080f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pytest_django/django_compat.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44

55
def is_django_unittest(request_or_item):
66
"""Returns True if the request_or_item is a Django test case, otherwise False"""
7-
try:
8-
from django.test import SimpleTestCase as TestCase
9-
except ImportError:
10-
from django.test import TestCase
7+
from django.test import SimpleTestCase
118

129
cls = getattr(request_or_item, 'cls', None)
1310

1411
if cls is None:
1512
return False
1613

17-
return issubclass(cls, TestCase)
14+
return issubclass(cls, SimpleTestCase)

0 commit comments

Comments
 (0)