Merge "Use setUpModule instead of setup for module level unit test setup"

This commit is contained in:
Jenkins 2017-05-24 21:29:09 +00:00 committed by Gerrit Code Review
commit 6f7b1f9ee2
2 changed files with 9 additions and 14 deletions

View File

@ -16,15 +16,18 @@
import unittest
from test.unit.proxy import test_server
from test.unit.proxy.test_server import teardown
from swift.obj import mem_server
def setup():
def setUpModule():
test_server.do_setup(mem_server)
def tearDownModule():
test_server.tearDownModule()
class TestController(test_server.TestController):
pass
@ -72,8 +75,4 @@ class TestAccountControllerFakeGetResponse(
if __name__ == '__main__':
setup()
try:
unittest.main()
finally:
teardown()
unittest.main()

View File

@ -116,11 +116,11 @@ def unpatch_policies(f):
return wrapper
def setup():
def setUpModule():
do_setup(object_server)
def teardown():
def tearDownModule():
teardown_servers(_test_context)
@ -9241,8 +9241,4 @@ class TestSocketObjectVersions(unittest.TestCase):
if __name__ == '__main__':
setup()
try:
unittest.main()
finally:
teardown()
unittest.main()