mirror of https://github.com/zulip/zulip.git
Extract run_test() method in back end tests.
(imported from commit 264bf689b282fccf8b4e423060fe0c4d2708b934)
This commit is contained in:
parent
e0c05ea7a9
commit
cdc095c3b3
|
@ -2945,6 +2945,10 @@ class MyResult:
|
||||||
'''
|
'''
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def run_test(test):
|
||||||
|
result = MyResult()
|
||||||
|
test(result)
|
||||||
|
|
||||||
class Runner(DjangoTestSuiteRunner):
|
class Runner(DjangoTestSuiteRunner):
|
||||||
option_list = ()
|
option_list = ()
|
||||||
|
|
||||||
|
@ -2952,14 +2956,8 @@ class Runner(DjangoTestSuiteRunner):
|
||||||
DjangoTestSuiteRunner.__init__(self, *args, **kwargs)
|
DjangoTestSuiteRunner.__init__(self, *args, **kwargs)
|
||||||
|
|
||||||
def run_suite(self, suite):
|
def run_suite(self, suite):
|
||||||
# This is a simplified version of run_suite
|
|
||||||
# that does simple iteration and plugs in our
|
|
||||||
# own Results class that allows us to fail fast
|
|
||||||
# and add easy hooks to show which tests are running
|
|
||||||
# in real time.
|
|
||||||
result = MyResult()
|
|
||||||
for test in suite:
|
for test in suite:
|
||||||
test(result)
|
run_test(test)
|
||||||
|
|
||||||
# Subsume run_tests under our control. This is literally copied
|
# Subsume run_tests under our control. This is literally copied
|
||||||
# from /Library/Python/2.7/site-packages/django/test/simple.py.
|
# from /Library/Python/2.7/site-packages/django/test/simple.py.
|
||||||
|
|
Loading…
Reference in New Issue