Python unittesting method call issue

Ian Kelly ian.g.kelly at gmail.com
Sun Sep 28 02:27:27 CEST 2014


On Sat, Sep 27, 2014 at 5:25 PM, Milson Munakami <milsonmun at gmail.com> wrote:
> I am trying to set the precondition for the test first prior to test other test cases. But as you can see in my code the precondition print command is not fired! Can you explain the cause and solution how to fire the code with in that method i.e. SetPreConditionFirewall() with setup variable self.<variablename> in this fucntion. Here is my code:

The method doesn't run because you never called it, and the name has
no special meaning to unittest, so unittest is not going to call it
for you.

The method that gets called prior to each test is setUp. So if you
want SetPreConditionFirewall to be called before each test, then call
it from setUp.



More information about the Python-list mailing list