Skip to content

Instantly share code, notes, and snippets.

@bukzor
Created January 10, 2013 17:30
Show Gist options
  • Save bukzor/4504037 to your computer and use it in GitHub Desktop.
Save bukzor/4504037 to your computer and use it in GitHub Desktop.
Demonstrate the skeleton of a testing strategy for pudb.
#!/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