pytest:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import pytest
class TestLogin:
def setup_class(self):
print("在每个类执行前的初始化工作,如创建日志对象,创建数据库链接")
def setup(self):
print("在执行用例之前初始化代码,如打开浏览器")
def test_01_login(self):
print("测试pytest")
def test_02_login(self):
print("测试pytest")
def test_03_login(self):
print("测试pytest")
def test_04_login(self):
print("测试pytest")
def teardown(self):
print("在执行用例后执行扫尾代码,如关闭浏览器")
def teardown_class(self):
print("在每个类执行之后的扫尾工作,如销毁日志对象,销毁数据库链接")
pytest的都是小写