Browse Source

Test deardown: Don't use atexit but nose's teardown() functionality instead.

Closes #154. Thanks to gthb
Ask Solem 14 years ago
parent
commit
afd92910cf
2 changed files with 5 additions and 8 deletions
  1. 5 0
      celery/tests/__init__.py
  2. 0 8
      celery/tests/config.py

+ 5 - 0
celery/tests/__init__.py

@@ -5,3 +5,8 @@ config = os.environ.setdefault("CELERY_TEST_CONFIG_MODULE",
 
 os.environ["CELERY_CONFIG_MODULE"] = config
 os.environ["CELERY_LOADER"] = "default"
+
+def teardown():
+    import os
+    if os.path.exists("test.db"):
+        os.remove("test.db")

+ 0 - 8
celery/tests/config.py

@@ -1,5 +1,3 @@
-import atexit
-
 CARROT_BACKEND = "memory"
 
 
@@ -13,9 +11,3 @@ CELERY_DEFAULT_ROUTING_KEY = "testcelery"
 CELERY_QUEUES = {"testcelery": {"binding_key": "testcelery"}}
 
 CELERYD_LOG_COLOR = False
-
-@atexit.register
-def teardown_testdb():
-    import os
-    if os.path.exists("test.db"):
-        os.remove("test.db")