#!/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的版本信息。
这里写图片描述

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐