[Python-checkins] r85500 - python/branches/py3k/Lib/test/test_doctest.py

florent.xicluna python-checkins at python.org
Thu Oct 14 23:35:58 CEST 2010


Author: florent.xicluna
Date: Thu Oct 14 23:35:58 2010
New Revision: 85500

Log:
Add test case for issue #9409, non-ascii char in doctest.  It passes in 3.2 but needs fixing in 2.7.


Modified:
   python/branches/py3k/Lib/test/test_doctest.py

Modified: python/branches/py3k/Lib/test/test_doctest.py
==============================================================================
--- python/branches/py3k/Lib/test/test_doctest.py	(original)
+++ python/branches/py3k/Lib/test/test_doctest.py	Thu Oct 14 23:35:58 2010
@@ -1697,6 +1697,9 @@
 
       >>> doc = '''
       ... >>> x = 42
+      ... >>> raise Exception('clé')
+      ... Traceback (most recent call last):
+      ... Exception: clé
       ... >>> import pdb; pdb.set_trace()
       ... '''
       >>> parser = doctest.DocTestParser()
@@ -1716,12 +1719,12 @@
       >>> try: runner.run(test)
       ... finally: sys.stdin = real_stdin
       --Return--
-      > <doctest foo-bär at baz[1]>(1)<module>()->None
+      > <doctest foo-bär at baz[2]>(1)<module>()->None
       -> import pdb; pdb.set_trace()
       (Pdb) print(x)
       42
       (Pdb) continue
-      TestResults(failed=0, attempted=2)
+      TestResults(failed=0, attempted=3)
 
       You can also put pdb.set_trace in a function called from a test:
 


More information about the Python-checkins mailing list