其他分享
首页 > 其他分享> > 【allure】测试报告

【allure】测试报告

作者:互联网

#代码示例:
import pytest,time
import allure

@allure.feature('demo模块')
@allure.story('登录功能')
class Test_class:
    @allure.title('正常登录')
    @allure.severity('P1级用例')
    @allure.testcase('https://www.cnblogs.com/hls-code/p/15166015.html')
    def test_001(self):
        a = 'hello'
        b = 'hello world'
        time.sleep(1)
        assert a != b
        print('测试用例--001')

    @allure.title('异常登录')
    @allure.description('密码错误')
    @allure.testcase('http://t.zoukankan.com/liudinglong-p-13056109.html')
    def test_002(self):
        a = 1
        b = 2
        assert a+b == 3
        time.sleep(1)
        print('测试用例--002')

@allure.feature('demo模块')
@allure.testcase('https://www.baodu.com')
@allure.issue('bug链接')
@pytest.mark.xfail
def test_003():
    a = 'hello'
    b = 'hello world'
    time.sleep(1)
    assert a in b
    print('测试用例--003')

标签:测试报告,--,pytest,allure,https,report,com
来源: https://www.cnblogs.com/xwltest/p/16585947.html