Created
January 10, 2013 17:30
-
-
Save bukzor/4504037 to your computer and use it in GitHub Desktop.
Demonstrate the skeleton of a testing strategy for pudb.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"pudb test script" | |
from pudb.debugger import Debugger | |
def dedent(text): | |
"dedent and strip" | |
from textwrap import dedent as _dedent | |
return _dedent(text).strip('\n') | |
D = dedent | |
import urwid | |
import urwid.html_fragment as H | |
def main(): | |
"The entry point" | |
dbg = Debugger() | |
screen = H.HtmlGenerator() | |
screen.sizes = [ (80, 24) ] | |
screen.keys = [ ] | |
dbg.ui.screen = screen | |
dbg.ui.setup_palette(screen) | |
try: | |
dbg._runscript('trivial.py') | |
except urwid.main_loop.ExitMainLoop: | |
pass | |
print '\n'.join(screen.fragments) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment