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() ... print fn >>> import pdb; pdb.set_trace()
So now you can just call contents() and copy paste the file path in your real browser and see what’s happening in your tests. May it can be added to testbrowser.Browser ?