diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-06-21 17:02:49 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-06-21 17:02:49 -0500 |
commit | 29f1333e722c10d3eff106bd64bb2ded0207e975 (patch) | |
tree | f793d6ef44c69784559debd94630753676d19487 /mediagoblin/tests/tools.py | |
parent | 26c61fc843f8bd54704d8dbb1e3edd021e100cbd (diff) | |
download | mediagoblin-29f1333e722c10d3eff106bd64bb2ded0207e975.tar.lz mediagoblin-29f1333e722c10d3eff106bd64bb2ded0207e975.tar.xz mediagoblin-29f1333e722c10d3eff106bd64bb2ded0207e975.zip |
Extra checks so that we don't even RUN tests unless the right celery environ set
Diffstat (limited to 'mediagoblin/tests/tools.py')
-rw-r--r-- | mediagoblin/tests/tools.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/mediagoblin/tests/tools.py b/mediagoblin/tests/tools.py index b35d54e0..ebb5f1b5 100644 --- a/mediagoblin/tests/tools.py +++ b/mediagoblin/tests/tools.py @@ -42,17 +42,23 @@ USER_DEV_DIRECTORIES_TO_SETUP = [ 'media/public', 'media/queue', 'beaker/sessions/data', 'beaker/sessions/lock'] +BAD_CELERY_MESSAGE = """\ +Sorry, you *absolutely* must run nosetests with the +mediagoblin.celery_setup.from_tests module. Like so: +$ CELERY_CONFIG_MODULE=mediagoblin.celery_setup.from_tests ./bin/nosetests""" + class BadCeleryEnviron(Exception): pass -def get_test_app(dump_old_app=True): +def suicide_if_bad_celery_environ(): if not os.environ.get('CELERY_CONFIG_MODULE') == \ 'mediagoblin.celery_setup.from_tests': - raise BadCeleryEnviron( - u"Sorry, you *absolutely* must run nosetests with the\n" - u"mediagoblin.celery_setup.from_tests module. Like so:\n" - u"$ CELERY_CONFIG_MODULE=mediagoblin.celery_setup.from_tests ./bin/nosetests") + raise BadCeleryEnviron(BAD_CELERY_MESSAGE) + + +def get_test_app(dump_old_app=True): + suicide_if_bad_celery_environ() global MGOBLIN_APP global CELERY_SETUP |