allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: Make test_import_tool_failed able to run on its own (can happen with some multi-process tests runs)
Date Tue, 04 Oct 2016 15:30:56 GMT
Repository: allura
Updated Branches:
  refs/heads/master c520be970 -> 67b553ce2


Make test_import_tool_failed able to run on its own (can happen with some multi-process tests
runs)


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

Branch: refs/heads/master
Commit: 67b553ce266635085b256d26bb41a1020a15ca6d
Parents: c520be9
Author: Dave Brondsema <dave@brondsema.net>
Authored: Tue Oct 4 11:30:45 2016 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Tue Oct 4 11:30:45 2016 -0400

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/tests/test_base.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/67b553ce/ForgeImporters/forgeimporters/tests/test_base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/test_base.py b/ForgeImporters/forgeimporters/tests/test_base.py
index e617edd..5f214ac 100644
--- a/ForgeImporters/forgeimporters/tests/test_base.py
+++ b/ForgeImporters/forgeimporters/tests/test_base.py
@@ -24,7 +24,7 @@ from tg import expose, config
 from nose.tools import assert_equal, assert_raises
 from webob.exc import HTTPUnauthorized
 
-from alluratest.controller import TestController
+from alluratest.controller import TestController, setup_basic_test
 from allura.tests import decorators as td
 from allura.lib import helpers as h
 
@@ -81,6 +81,7 @@ def test_import_tool(g, c, object_from_path, M, _datetime):
 @mock.patch.object(base, 'ToolImporter')
 @mock.patch.object(base, 'g')
 def test_import_tool_failed(g, ToolImporter, format_exc):
+    setup_basic_test()
     format_exc.return_value = 'my traceback'
 
     importer = mock.Mock(source='importer_source',
@@ -88,9 +89,8 @@ def test_import_tool_failed(g, ToolImporter, format_exc):
     importer.import_tool.side_effect = RuntimeError('my error')
     ToolImporter.return_value = importer
 
-    assert_raises(
-        RuntimeError, base.import_tool, 'forgeimporters.base.ToolImporter',
-        project_name='project_name')
+    with assert_raises(RuntimeError):
+        base.import_tool('forgeimporters.base.ToolImporter', project_name='project_name')
     g.post_event.assert_called_once_with(
         'import_tool_task_failed',
         error=str(importer.import_tool.side_effect),


Mime
View raw message