Python doctest.debug_src() Examples
The following are 11
code examples of doctest.debug_src().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
doctest
, or try the search function
.
Example #1
Source File: test_doctest.py From ironpython2 with Apache License 2.0 | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print x ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> import tempfile >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print x', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print x 12 (Pdb) continue """
Example #2
Source File: test_doctest.py From BinderFilter with MIT License | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print x ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> import tempfile >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print x', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print x 12 (Pdb) continue """
Example #3
Source File: test_doctest.py From oss-ftp with MIT License | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print x ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> import tempfile >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print x', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print x 12 (Pdb) continue """
Example #4
Source File: test_doctest.py From Fluid-Designer with GNU General Public License v3.0 | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print(x) ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print(x)', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print(x) 12 (Pdb) continue """
Example #5
Source File: test_doctest.py From ironpython3 with Apache License 2.0 | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print(x) ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print(x)', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print(x) 12 (Pdb) continue """
Example #6
Source File: test_doctest.py From gcblue with BSD 3-Clause "New" or "Revised" License | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print x ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> import tempfile >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print x', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print x 12 (Pdb) continue """
Example #7
Source File: test_doctest.py From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print(x) ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print(x)', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print(x) 12 (Pdb) continue """
Example #8
Source File: test_doctest.py From medicare-demo with Apache License 2.0 | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print x ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> import tempfile >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print x', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print x 12 (Pdb) continue """
Example #9
Source File: test_doctest.py From CTFCrackTools-V2 with GNU General Public License v3.0 | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print x ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> import tempfile >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print x', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print x 12 (Pdb) continue """
Example #10
Source File: test_doctest.py From android_universal with MIT License | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print(x) ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print(x)', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print(x) 12 (Pdb) continue """
Example #11
Source File: test_doctest.py From CTFCrackTools with GNU General Public License v3.0 | 5 votes |
def test_debug(): r""" Create a docstring that we want to debug: >>> s = ''' ... >>> x = 12 ... >>> print x ... 12 ... ''' Create some fake stdin input, to feed to the debugger: >>> import tempfile >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput(['next', 'print x', 'continue']) Run the debugger on the docstring, and then restore sys.stdin. >>> try: doctest.debug_src(s) ... finally: sys.stdin = real_stdin > <string>(1)<module>() (Pdb) next 12 --Return-- > <string>(1)<module>()->None (Pdb) print x 12 (Pdb) continue """