incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [23/27] git commit: [#6276] don't run run test setup functions extra times as if they were tests themselves
Date Fri, 07 Jun 2013 23:42:18 GMT
[#6276] don't run run test setup functions extra times as if they were tests themselves


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b2929b8e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b2929b8e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b2929b8e

Branch: refs/heads/db/6276
Commit: b2929b8e8f0d5fea9a16eb72f15c25e536048efe
Parents: 3ba5a1a
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Thu Jun 6 17:19:06 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Fri Jun 7 21:19:38 2013 +0000

----------------------------------------------------------------------
 AlluraTesting/alluratest/controller.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b2929b8e/AlluraTesting/alluratest/controller.py
----------------------------------------------------------------------
diff --git a/AlluraTesting/alluratest/controller.py b/AlluraTesting/alluratest/controller.py
index dd81b23..95d9b4b 100644
--- a/AlluraTesting/alluratest/controller.py
+++ b/AlluraTesting/alluratest/controller.py
@@ -44,6 +44,11 @@ from .validation import ValidatingTestApp
 
 DFL_APP_NAME = 'main_without_authn'
 
+# these are all helpers & base classes, and should never
+# be considered test cases when imported into some test module
+__test__ = False
+
+
 def get_config_file(config=None):
     if not config:
         config = 'test.ini'
@@ -54,6 +59,7 @@ def get_config_file(config=None):
         conf_dir = os.getcwd()
     return os.path.join(conf_dir, config)
 
+
 def setup_basic_test(config=None, app_name=DFL_APP_NAME):
     '''Create clean environment for running tests'''
     try:
@@ -68,6 +74,8 @@ def setup_basic_test(config=None, app_name=DFL_APP_NAME):
     # run all tasks, e.g. indexing from bootstrap operations
     while M.MonQTask.run_ready('setup'):
         ThreadLocalORMSession.flush_all()
+setup_basic_test.__test__ = False  # sometimes __test__ above isn't sufficient
+
 
 def setup_functional_test(config=None, app_name=DFL_APP_NAME):
     '''Create clean environment for running tests.  Also return WSGI test app'''
@@ -77,6 +85,8 @@ def setup_functional_test(config=None, app_name=DFL_APP_NAME):
     wsgiapp = loadapp('config:%s#%s' % (config, app_name),
                       relative_to=conf_dir)
     return wsgiapp
+setup_functional_test.__test__ = False  # sometimes __test__ above isn't sufficient
+
 
 def setup_unit_test():
     try:
@@ -97,6 +107,8 @@ def setup_unit_test():
     c.queued_messages = None
     c.model_cache = None
     ThreadLocalORMSession.close_all()
+setup_unit_test.__test__ = False  # sometimes __test__ above isn't sufficient
+
 
 def setup_global_objects():
     setup_unit_test()


Mime
View raw message