You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by di...@apache.org on 2022/09/23 17:37:26 UTC

[allura] 03/03: fixup! fixup! fixup! [#8455] converted the remaining modules fully to pytest

This is an automated email from the ASF dual-hosted git repository.

dill0wn pushed a commit to branch dw/8455-part2
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 2fd83088236b31aa60956a009b2331e575d9ee86
Author: Dillon Walls <di...@slashdotmedia.com>
AuthorDate: Fri Sep 23 17:37:17 2022 +0000

    fixup! fixup! fixup! [#8455] converted the remaining modules fully to pytest
---
 Allura/allura/tests/model/test_artifact.py   | 11 ++++-------
 Allura/allura/tests/model/test_discussion.py |  4 ++--
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/Allura/allura/tests/model/test_artifact.py b/Allura/allura/tests/model/test_artifact.py
index 25863cc6f..940ae0cac 100644
--- a/Allura/allura/tests/model/test_artifact.py
+++ b/Allura/allura/tests/model/test_artifact.py
@@ -55,15 +55,16 @@ class Checkmessage(M.Message):
 Mapper.compile_all()
 
 
-# def setup_method_wrapper(fn):
-#     fn(None)
-
 def setup_method():
     setup_basic_test()
     setup_unit_test()
     setup_with_tools()
 
 
+def teardown_module():
+    ThreadLocalORMSession.close_all()
+
+
 @td.with_wiki
 def setup_with_tools():
     h.set_context('test', 'wiki', neighborhood='Projects')
@@ -76,10 +77,6 @@ def setup_with_tools():
     Checkmessage.app_config = c.app.config
 
 
-def tearDown():
-    ThreadLocalORMSession.close_all()
-
-
 @with_setup(setup_method)
 def test_artifact():
     pg = WM.Page(title='TestPage1')
diff --git a/Allura/allura/tests/model/test_discussion.py b/Allura/allura/tests/model/test_discussion.py
index 1bfc445b9..d5abf1a05 100644
--- a/Allura/allura/tests/model/test_discussion.py
+++ b/Allura/allura/tests/model/test_discussion.py
@@ -49,7 +49,7 @@ def setup_method():
     ThreadLocalORMSession.close_all()
 
 
-def tearDown():
+def teardown_module():
     ThreadLocalORMSession.close_all()
 
 
@@ -209,7 +209,7 @@ def test_attachment_methods():
         n.text)
 
 
-@with_setup(setup_method, tearDown())
+@with_setup(setup_method)
 def test_multiple_attachments():
     test_file1 = FieldStorage()
     test_file1.name = 'file_info'