diff options
| author | Georg Brandl <georg@python.org> | 2010-07-30 09:18:49 (GMT) |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2010-07-30 09:18:49 (GMT) |
| commit | f833a56fd29e8dd8c926397d91ed88367edce5ca (patch) | |
| tree | 5ab195c8b84cc86166010f9b936a3cd27bb12896 /Lib/test | |
| parent | c9a5ed04c1c90d0aaf58f6d51d639b4e10f30ad4 (diff) | |
| download | cpython-f833a56fd29e8dd8c926397d91ed88367edce5ca.zip cpython-f833a56fd29e8dd8c926397d91ed88367edce5ca.tar.gz cpython-f833a56fd29e8dd8c926397d91ed88367edce5ca.tar.bz2 | |
#7539: use _saferepr() for printing exceptions from pdb.
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_pdb.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index ce64d17..0ef525e 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -126,6 +126,33 @@ def test_pdb_skip_modules_with_callback(): """ +def test_pdb_unicode_exception(): + r"""This tests exceptions that cannot be displayed due to Unicode issues. + http://bugs.python.org/issue7539 + + >>> def test_function(): + ... import pdb; pdb.Pdb().set_trace() + ... pass + + >>> def raising_function(): + ... raise ValueError(u"\xff") + + >>> with PdbTestInput([ + ... 'raising_function()', + ... 'p raising_function()', + ... 'continue', + ... ]): + ... test_function() + > <doctest test.test_pdb.test_pdb_unicode_exception[0]>(3)test_function() + -> pass + (Pdb) raising_function() + *** ValueError: ValueError(u'\xff',) + (Pdb) p raising_function() + *** ValueError: ValueError(u'\xff',) + (Pdb) continue + """ + + def test_main(): from test import test_pdb test_support.run_doctest(test_pdb, verbosity=True) |
