0
点赞
收藏
分享

微信扫一扫

参数计划

笙烛 2023-06-28 阅读 57

import pytest

@pytest.fixture(scope='session', autouse=True) def connect_db(): print("Connect Database in .......") yield print("Close Database out .......")

def test1(): print("test1")

def test2(): print("test")

============================= test session starts ============================= platform win32 -- Python 3.6.8, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- D:\Coding\Python3.6\python.exe cachedir: .pytest_cache rootdir: C:\Users\libuliduobuqiuqiu\Desktop\GitProjects\PythonDemo\pytest plugins: Faker-8.11.0 collecting ... collected 2 items

test_example.py::test1 Connect Database in ....... PASSED [ 50%]test1

test_example.py::test2 PASSED [100%]test Close Database out .......

举报

相关推荐

计划

2019计划

收入计划

旅行计划。

小计划

学习计划

0 条评论