def is_django_unittest(request_or_item):
    """Returns True if the request_or_item is a Django test case, otherwise False"""
    try:
        from django.test import SimpleTestCase as TestCase
    except __HOLE__:
        from django.test import TestCase

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

    if cls is None:
        return False

    return issubclass(cls, TestCase)
dataset/ETHPy150Open pytest-dev/pytest-django/pytest_django/django_compat.py/is_django_unittest