[Tutor] unittest skipping tests

Walter Prins wprins at gmail.com
Thu Aug 1 14:44:42 CEST 2013


Hi,

On 1 August 2013 13:11, Matthew Ngaha <chigga101 at gmail.com> wrote:

> im trying to do some unittesting and i've written 1 class with 4 test
> methods and it skips 2 of these methods for no reason. If i comment
> out the 2 it doesn't skip, it will now test the 2 it previously
> skipped. Is this the default behaviour to only test 2 methods in a
> class?


No.  (That would be silly, nay, crazy even.)



> Anyone have any ideas how i can solve this problem?


Alan's answer is the first port of call.  You really need to give us more
to work with, otherwise we're just guessing, and if we have to guess it
makes our lives and your life more difficult than it needs to be.

That said, what you describe makes me suspect indentation problems of some
sort.  It sounds almost as if the latter test methods are somehow
considered to be inside the former test code, such that they're not "seen"
by the testing framework's test discovery process.  And, when you then
comment out the prior 2 methods, the latter 2 become "visible" due to not
being in the former's enclosing scope.  Or something like that.  But,
that's just a guess, and may be way off base...


Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130801/6daeffd3/attachment.html>


More information about the Tutor mailing list