Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70792 > unrolled thread

Re: unittest weirdness

Started byEthan Furman <ethan@stoneleaf.us>
First post2014-04-30 16:32 -0700
Last post2014-04-30 16:32 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: unittest weirdness Ethan Furman <ethan@stoneleaf.us> - 2014-04-30 16:32 -0700

#70792 — Re: unittest weirdness

FromEthan Furman <ethan@stoneleaf.us>
Date2014-04-30 16:32 -0700
SubjectRe: unittest weirdness
Message-ID<mailman.9617.1398902205.18130.python-list@python.org>
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~

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web