Permalink
Browse files

teardown metlog when tests wrap up

  • Loading branch information...
1 parent 7386105 commit 549f256b69ec8a1f283d51b20da358fddee95fcc @rafrombrc rafrombrc committed Mar 12, 2012
Showing with 8 additions and 3 deletions.
  1. +4 −2 syncstorage/tests/functional/support.py
  2. +4 −1 syncstorage/tests/test_wsgiapp.py
@@ -8,15 +8,14 @@
import urlparse
import random
-from mozsvc.metrics import setup_metlog
+from mozsvc.metrics import setup_metlog, teardown_metlog
from mozsvc.tests.support import FunctionalTestCase
class StorageFunctionalTestCase(FunctionalTestCase):
def setUp(self):
super(StorageFunctionalTestCase, self).setUp()
- setup_metlog(self.config.registry.settings.getsection('metlog'))
# We only support mysql and sqlite databases.
# Check that the config keys match this expectation.
@@ -46,9 +45,12 @@ def tearDown(self):
if os.path.exists(sqlfile):
os.remove(sqlfile)
+ teardown_metlog()
+
super(StorageFunctionalTestCase, self).tearDown()
def get_test_configurator(self):
config = super(StorageFunctionalTestCase, self).get_test_configurator()
+ setup_metlog(config.registry.settings.getsection('metlog'))
config.include("syncstorage")
return config
@@ -3,7 +3,7 @@
# You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
-from mozsvc.metrics import setup_metlog
+from mozsvc.metrics import setup_metlog, teardown_metlog
from mozsvc.tests.support import get_test_configurator, make_request
from syncstorage.storage import get_storage
@@ -16,6 +16,9 @@ def setUp(self):
setup_metlog(self.config.registry.settings.getsection('metlog'))
self.config.include("syncstorage")
+ def tearDown(self):
+ teardown_metlog()
+
def _make_request(self, *args, **kwds):
return make_request(self.config, *args, **kwds)

0 comments on commit 549f256

Please sign in to comment.