unittest weirdness
Ethan Furman
ethan at stoneleaf.us
Wed Apr 30 19:32:46 EDT 2014
On 03/11/2014 01:58 PM, Ethan Furman wrote:
>
> So I finally got enough data and enough of an understanding to write some unit tests for my code.
> The weird behavior I'm getting:
>
> - when a test fails, I get the E or F, but no summary at the end
> (if the failure occurs in setUpClass before my tested routines
> are actually called, I get the summary; if I run a test method
> individually I get the summary)
>
> - I have two classes, but only one is being exercised
>
> - occasionally, one of my gvim windows is unceremoniously killed
> (survived only by its swap file)
>
> I'm running the tests under sudo as the routines expect to be run that way.
>
> Anybody have any ideas?
For posterity's sake:
I added a .close() method to the class being tested which destroys its big data structures; then I added a tearDownClass
method to the unittest. That seems to have done the trick with getting the tests to /all/ run, and by apps don't
suddenly disappear. :)
--
~Ethan~
More information about the Python-list
mailing list