Merge "Use setUpModule instead of setup for module level unit test setup"
This commit is contained in:
commit
6f7b1f9ee2
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue