Вывод журнала Python testtools - PullRequest
       4

Вывод журнала Python testtools

0 голосов
/ 12 января 2019

Хеллом, я пытаюсь выполнить мои тесты с помощью testtools, вот код моего бегуна

def split_suite_into_chunks(n, suite):
    # Keep n to a reasonable number of threads
    if n < 0:
        n = 1
    if n > 8:
        n = 8
    # Compute n such that the number of threads does not exceed the value passed to the function
    n = math.ceil(suite.countTestCases() / n)
    s = []
    i = 0
    s_tmp = unittest.TestSuite()
    for case in suite:
        if i < n:
            s_tmp.addTest(case)
            i += 1
        if i == n:
            s.append([s_tmp, None])
            i = 0
            s_tmp = unittest.TestSuite()
    if (i > 0):
        s.append([s_tmp, None])
    return s

def add_test_case_to_suite(suite, tc_name):
    # Creates a Test Suite with each Test Case added n times
    n = 1
    for i in range(0, n):
        suite.addTest(tc_name)

def get_suite():
    loader = TestLoader()
    suite = TestSuite((loader.loadTestsFromTestCase(StatusesCheckManual)))
    return suite

if __name__ == "__main__":
    # This is what sets the number of threads
    num_threads = 4
    suite = get_suite()
    concurrent_suite = testtools.ConcurrentStreamTestSuite(lambda: (split_suite_into_chunks(num_threads, suite)))
    concurrent_suite.run(testtools.StreamResult())

Работает нормально, но я не получаю никаких журналов, кроме

Process finished with exit code 0

Даже если и было исключение, оно не отображается. Как я могу включить это?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...