Python pytest测试
#!/usr/bin/env python# -*- coding:utf-8 -*-import itchatimport timedef func(x):return x+1def test_answer():assert func(3)==5#!/usr/bin/env python# -*- coding:utf-8 -*-import
·
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import itchat
import time
def func(x):
return x+1
def test_answer():
assert func(3)==5
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import itchat
import time
class TestClass:
def test_one(self):
x='this'
assert 'l' in x
def test_two(self):
x='hello'
assert x=='hi'
-q 为quiet。表示在安静的模式输出报告,可以省略pytest的版本信息。
更多推荐
已为社区贡献2条内容
所有评论(0)