Python script to generate JUnit report from another testing result

后端 未结 6 1904
悲哀的现实
悲哀的现实 2021-02-01 21:53

I have an acceptance test case, the result is plain text. I want to use Jenkins to show the result, and the JUnit format is suitable for me.

So I want to check whether t

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-01 22:17

    I found one python module https://bitbucket.org/db_atlass/python-junit-xml-output-module/ , looks fit to my need. thx David Black there

    # code snippet for the usage
    """ a short example of how to use this module """
    test_cases = []
    for i in range(0, 5):
        type_c = ""
        if i % 2 == 0:
            type_c = "failure"
        test_cases.append(TestCase(i, str(i) + "contents", type_c) )
    
    junit_xml = JunitXml("demo test example", test_cases)
    

提交回复
热议问题