Pythonpytest库进行代码测试

网友投稿 511 2022-05-29

文档:https://docs.pytest.org/en/stable/

安装

Python:pytest库进行代码测试

pip install pytest

1

测试文件 test_hello.py

# -*- coding: utf-8 -*- import pytest # test_开头 def test_hello(): print('hello') if __name__ == '__main__': # 命令行运行 $ pytest pytest.main(['-s', __file__])

1

2

3

4

5

6

7

8

9

10

11

12

13

Python

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:【乘风破浪的开发者】华为云云享专家胡琦:快快使用ModelArts,零基础也能玩转AI!
下一篇:OCR性能优化系列(二):从神经网络到橡皮泥
相关文章