Skip to content

Commit

Permalink
Work around unittest issue with pytest 5.4.{0,1}
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Mar 14, 2020
1 parent 46f59f7 commit 6992412
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,12 @@ def _django_setup_unittest(request, django_db_blocker):

from _pytest.unittest import TestCaseFunction

if "debug" in TestCaseFunction.runtest.__code__.co_names:
if True or "debug" in TestCaseFunction.runtest.__code__.co_names:
# Fix pytest (https://github.com/pytest-dev/pytest/issues/5991), only
# if "self._testcase.debug()" is being used (forward compatible).
#
# But also later still for now (5.4.1),
# https://github.com/pytest-dev/pytest-django/issues/824.
from _pytest.monkeypatch import MonkeyPatch

def non_debugging_runtest(self):
Expand Down

0 comments on commit 6992412

Please sign in to comment.