Add try/finally in tests to make sure teardown() is called.