Functional doctest snippet of the day
I was looking for an easy way to get the current browser.contents in my real browser to easy debug what is happening in my doctest. Here is the snippet: Updated the 01/13/2009 >>> import tempfile as tmp >>> def contents(): ... fd, fn = tmp.mkstemp(suffix=".html", prefix="testbrowser-") ... file = open(fn, 'w') ... file.write(browser.contents) ... file.close() [...]
Étiquettes: