Closed pcostell closed 9 years ago
Thank you, this is a useful feature to have. I'll try not to take too long to review it; please ping me if I get distracted.
I've a vague feeling of deja vu about a similar patch/bug where there was talk of making filename
accept a file-like object (e.g. a StringIO), but I can't find it! Was it merely a comment on an unrelated bug?
Ya I saw another pull request with something similar but it looks like it didn't get pulled through because it had some outstanding issues that were never addressed.
Oh, right, that was #8.
Looks good to me. I think I'll merge and fix the two remaining nitpicks myself.
Awesome. Please do nitpick!
On Python 3 I see extra warnings:
tests.py:51: DeprecationWarning: Please use assertRegex instead.
self.assertRegexpMatches(output_value, r'digraph ObjectGraph')
any ideas about getting rid of them?
Would a global search & replace of assertRegexpMatches to assertRegex suffice?
Ya that would probably work -- we can name the one in the Py25 compatibility mix-in to assertRegex.
Python 3.1 is a special case that makes things interesting, but I think I got it (commit 807a940).
This adds an
output
parameter toshow_graph
which accepts any file-like object (in this case something that supports write()). Ifoutput
is specified,show_graph
will write to this object instead of creating its own file.If
output
is specified then it is illegal to specifyfilename
.