Skip to content

Commit

Permalink
Construct the replacement setUpClass/tearDownClass in a Python 3 comp…
Browse files Browse the repository at this point in the history
…atible way
  • Loading branch information
pelme committed Jan 2, 2015
1 parent 8a9aacb commit 243323b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import contextlib

import pytest
import new
import types

from .django_compat import is_django_unittest
from .fixtures import (_django_db_setup, _live_server_helper, admin_client,
Expand Down Expand Up @@ -216,8 +216,8 @@ def pytest_runtest_setup(item):
cls.__real_setUpClass = cls.setUpClass
cls.__real_tearDownClass = cls.tearDownClass

cls.setUpClass = new.instancemethod(lambda cls: None, cls)
cls.tearDownClass = new.instancemethod(lambda cls: None, cls)
cls.setUpClass = types.MethodType(lambda cls: None, cls)
cls.tearDownClass = types.MethodType(lambda cls: None, cls)


@pytest.fixture(autouse=True, scope='session')
Expand Down

0 comments on commit 243323b

Please sign in to comment.