Zachary Ware added the comment:
I had a chance to look at this today and took a stab at writing a patch
(attached). Since moving all of the test functions into a TestCase subclass
necessarily means indenting everything another level, the patch is a huge ugly
mix of - and + lines that don't really have any relation to each other. As
such, I'll also be attaching another patch which is for review purposes only:
it differs from the real patch by only indenting the def statements by 2 spaces
instead of the usual 4, allowing the bodies of the methods to not be indented,
which makes the changes MUCH easier to keep track of.
As Chris mentioned previously, running the test in verbose mode (under
regrtest) causes rendering problems. I worked around this by adding a
"print('')" to the setUp method; it doesn't make things perfect, but it makes
it a bit easier to read. I'm not terribly attached to this hack, though, so
I'd be fine with removing it if anyone has a preference.
Also as Chris mentioned, there is an open question of how to do setup, whether
to do things in TestCase.setUp, TestCase,setUpClass, or setUpModule. This
patch does initial curses.setupterm() in setUpModule, then initscr and savetty
in setUp (with resetty and endwin in tearDown). However, this is not how the
module has been testing; it has been doing initscr/savetty and resetty/endwin
only once throughout execution. I've considered creating a subclass of the
TestCurses test class which would do initscr/savetty in setUpClass, to do all
the tests again on the same screen (as has been up to now), but I'd like
others' opinions on that before I write it.
Also, this patch is against default; I'll make sure it works for 3.3 after a
round or two of review.
----------
Added file: http://bugs.python.org/file30728/issue16000.v1.diff
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16000>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com