pytest

Posted on 2020-08-29 16:53  大白不白  阅读(162)  评论(0编辑  收藏  举报
class TestMy:
    def test_a(self):
        assert 1==1

    def test_b(self):
        assert 1>2




# main(['{}::{}'.format(__file__,TestMy.__name__)])

if __name__ == '__main__':
    pytest.main(["-q",'--html=report.html','test_1.py'])

用代码运行pytest,并生成测试报告

Copyright © 2024 大白不白
Powered by .NET 9.0 on Kubernetes