nose-devs/nose — Issue #197: Module fixture tearDownModule() not executed
Author: jpellerin
Created: 2011-12-14 16:03:26+00:00
State: open

I have a file called script_test.py which looks like this:

import os, warnings # and etc

def setUpModule():
# code for setting up database connection

def tearDownModule():
# code for closing database connection

class TestMyScript:
def setUp(self):
# set up each test

def tearDown(self):
# tear down each test

def testActionOne(self):
# run test

Running nosetests does not execute tearDownModule() function. When placing
an assert 1 == 0 in tearDownModule() all tests complete successfully.
Renaming tearDownModule() to tearDown() (and setUpModule() to setUp())
solves this problem.

This is with nosetests 0.9.3.

Google Code Info:
Issue #: 55
Author: mma...@gmail.com
Created On: 2007-04-28T02:07:07.000Z
Closed On: 2007-09-09T12:08:43.000Z