How do I create a single setup function all my nose test cases that is only called once during initialization? I have a global configuration that only needs to be set once and I feel that adding the following to each module (even calling a setup function for each module) is a bit superfluous:
Configuration.configure('some configuration settings')
I figured it out! Nose provides package-level setup and teardown as documented here. All I have to do is define the
setup method in the package's
Here, you can see an example of how to use the
setup function. To make things simple:
lines =  def setup(): global lines lines.append('test') # here, we can trigger a build # and read in a file, for example def test_this(): assert lines == 'test'