From 3f12d76118236194337f28447886d0d39a6e8e77 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Sat, 6 Sep 2014 14:04:09 +0200 Subject: [PATCH] Add ZAQAR_TEST_EVERYTHING to enable all tests We've a way to enable some tests that are environment dependant but there's no good way, other than setting all those variables, to enable all tests in a specific environment. This patch adds a new variable to do the above. It also DRYes a bit the check of env variables that have been set. Change-Id: Ia75925b4e22e27dab4d67caf67db80c191717caf --- zaqar/tests/helpers.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/zaqar/tests/helpers.py b/zaqar/tests/helpers.py index 032c01732..17ee9d719 100644 --- a/zaqar/tests/helpers.py +++ b/zaqar/tests/helpers.py @@ -22,9 +22,16 @@ import six import testtools -SKIP_SLOW_TESTS = os.environ.get('ZAQAR_TEST_SLOW') is None -SKIP_MONGODB_TESTS = os.environ.get('ZAQAR_TEST_MONGODB') is None -SKIP_REDIS_TESTS = os.environ.get('ZAQAR_TEST_REDIS') is None +RUN_ALL_TESTS = os.environ.get('ZAQAR_TEST_EVERYTHING') + + +def _test_variable_set(variable): + return os.environ.get(variable, RUN_ALL_TESTS) is None + + +SKIP_SLOW_TESTS = _test_variable_set('ZAQAR_TEST_SLOW') +SKIP_MONGODB_TESTS = _test_variable_set('ZAQAR_TEST_MONGODB') +SKIP_REDIS_TESTS = _test_variable_set('ZAQAR_TEST_REDIS') @contextlib.contextmanager