1. pytest测试代码

import pytest
import allure


class Test_ABC:

        @pytest.fixture()
        def before(self):
                print("------->before")
                yield
                print("------->after")

        @allure.feature("((《「分类」》))1")
        def test_a(self, before):  # test_a方式传入了被fixture「标识的函」数, 已变量的形式[
                print("------->test_a")
                assert 1

        @allure.feature("((《「分类」》))1")
        def test_b(self):
                print("------->test_b")
                assert 1

        @allure.feature("((《「分类」》))2")
        def test_c(self):
                print("------->test_c")
                assert 1

        @allure.feature("((《「分类」》))2")
        @pytest.mark.parametrize(('x', 'y'),
                                 [(4, 4), (5, 5), (3, 3)])
        def test_simple_assume(self, x, y):  # “『执行』多个断言需要”安装pytest-assume
                print("{测试数据}x=%s, y=%s" % (x, y))
                pytest.assume(x == y)
                pytest.assume(x + y > 2)
                pytest.assume(x > 1)
                print("《测试》完成!")


if __name__ == '__main__':
        pytest.main(['-s', 'test_demo.py', "--alluredir=report"])

2. jenkins『【设置】』

构[建-『执行』shell《下》令

#!/bin/bash
/usr/local/bin/pytest -s -q --alluredir=/Users/xxx/Documents/myjenkins/workspace/test_allure/report_test --clean-alluredir /Users/xxx/Documents/myresource/test/test_demo.py  
/usr/local/bin/allure generate --clean /Users/xxx/Documents/myjenkins/workspace/test_allure/report_test -o /Users/xxx/Documents/myjenkins/workspace/test_allure/report_test2

3. allure『【设置】』

需要安装Allure‘插件’

,

Allbet‘(官)网’ALLbet6.com

(欢迎)进入Allbet‘(官)网’(Allbet Game):www.aLLbetgame.us,欧博‘(官)网’是欧博集团的‘官方网站’。欧博‘(官)网’开放Allbet<注册>、Allbe《代理》、Allbet“电脑客户端”、Allbet「手机版」下载等业务。

,