diff options
| author | Adam Johnson <me@adamj.eu> | 2021-03-17 11:28:04 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-17 21:51:27 +0100 |
| commit | 46bdc3eaf08d24d5fad3823bb75f5f47b9ede1a9 (patch) | |
| tree | 6de11d96387a057b27b88c1ecc2f0beab71cad33 | |
| parent | 3ff859b7891fb3629ef7397ff5055f9721ec725d (diff) | |
[3.2.x] Fixed #32560 -- Fixed test runner with --pdb and --buffer on fail/error.
Backport of 45814af6197cfd8f4dc72ee43b90ecde305a1d5a from main
| -rw-r--r-- | django/test/runner.py | 2 | ||||
| -rw-r--r-- | docs/releases/3.1.8.txt | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/django/test/runner.py b/django/test/runner.py index 8e6c29b0b4..a5fe7b7ba0 100644 --- a/django/test/runner.py +++ b/django/test/runner.py @@ -102,6 +102,8 @@ class PDBDebugResult(unittest.TextTestResult): 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) diff --git a/docs/releases/3.1.8.txt b/docs/releases/3.1.8.txt index 3fa2a4f0c8..d166a1200c 100644 --- a/docs/releases/3.1.8.txt +++ b/docs/releases/3.1.8.txt @@ -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`). |
