Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 17F7B10BB9 for ; Fri, 7 Jun 2013 23:41:58 +0000 (UTC) Received: (qmail 43750 invoked by uid 500); 7 Jun 2013 23:41:58 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 43700 invoked by uid 500); 7 Jun 2013 23:41:58 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 43506 invoked by uid 99); 7 Jun 2013 23:41:57 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jun 2013 23:41:57 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A05168A0982; Fri, 7 Jun 2013 23:41:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tvansteenburgh@apache.org To: allura-commits@incubator.apache.org Date: Fri, 07 Jun 2013 23:42:18 -0000 Message-Id: <3eecf100bc244e5090bb118137197e0b@git.apache.org> In-Reply-To: <1ccbe82e88c14f838440761f0be101e9@git.apache.org> References: <1ccbe82e88c14f838440761f0be101e9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [23/27] git commit: [#6276] don't run run test setup functions extra times as if they were tests themselves [#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 Authored: Thu Jun 6 17:19:06 2013 +0000 Committer: Tim Van Steenburgh 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()