0
添加夾具我是新來的Python和我在pytestpytest:在測試文件,而不是conftest.py
test_client.py
# Simple Example tests
import pytest
def test_one():
assert False == False
def test_two():
assert True == True
def cleanup():
# do some cleanup stuff
conftest.py疑問
import pytest
import test_client
@pytest.fixture(scope="session", autouse=True)
def do_clean_up(request):
request.addfinalizer(test_client.cleanup)
是否可以移動定義在conftest.py到test_client.py從而消除具有conftest.py