« How to root and update your htc hero. | Main
Thursday
Oct212010

nosetests function names

Be careful with function names in tests when using nosetests and python 

Nose tests automatically runs all functions in discovered files with the word test in them. This can bite you if for instance you put a function build_test_smelter used to define some test data for a subclass of TestCase in a _init_.py file. 

As nosetests will run this function as well (without the setUp and tearDown methods, that clean your database) you will end up with two instances of your smelter instead of one. This will not show up it you run the tests in a single file but will show up when you use 

$ bin/nosetests 

from the command line as then it will discover that function in your _init_.py file

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (2)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    The main body of the research work is very essential. The details and all arguments about the theme of the assignment are written in the main body. The analysis is also done. The analysis is very crucial for the multiplicity of perspectives.
  • Response
    Nose tests are compulsory for the companies because it will make automatically files and different decisions. These tests run automatically without any command so it is a very relaxed test. People can feel relaxed and good.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>