Skip to content

Commit

Permalink
[3.1.x] Fixed #32560 -- Fixed test runner with --pdb and --buffer on …
Browse files Browse the repository at this point in the history
…fail/error.

Backport of 45814af from main
  • Loading branch information
adamchainz authored and felixxm committed Mar 17, 2021
1 parent b58b214 commit 95ee8fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions django/test/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def addFailure(self, test, err):
self.debug(err)

def debug(self, error):
self._restoreStdout()
self.buffer = False
exc_type, exc_value, traceback = error
print("\nOpening PDB: %r" % exc_value)
pdb.post_mortem(traceback)
Expand Down
4 changes: 3 additions & 1 deletion docs/releases/3.1.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ Django 3.1.8 fixes several bugs in 3.1.7.
Bugfixes
========

* ...
* Fixed a bug in Django 3.1 where the output was hidden on a test error or
failure when using :option:`test --pdb` with the
:option:`--buffer <test --buffer>` option (:ticket:`32560`).

0 comments on commit 95ee8fe

Please sign in to comment.