pytest icon indicating copy to clipboard operation
pytest copied to clipboard

when i run 'pytest.main()' to run all cases, the 'pytest_sessionstart' do not run?

Open fireblackman opened this issue 3 years ago • 0 comments

  • [ ] a detailed description of the bug or problem you are having -conftest.py
    `def pytest_sessionstart(): init_data()

def pytest_sessionfinish(): clear_data() ` -run_all_cases.py

if __name__ == '__main__': pytest.main()

  • [ ] output of pip list from the virtual environment you are using pip list Package Version

allure-pytest 2.9.45 allure-python-commons 2.9.45 async-generator 1.10 async-timeout 4.0.2 atomicwrites 1.4.1 attrs 22.1.0 bcrypt 3.2.2 certifi 2022.6.15 cffi 1.15.1 charset-normalizer 2.1.0 colorama 0.4.5 cryptography 37.0.4 defusedxml 0.7.1 Deprecated 1.2.13 elasticsearch 7.5.1 h11 0.13.0 idna 3.3 iniconfig 1.1.1 jira 3.3.1 oauthlib 3.2.0 outcome 1.2.0 packaging 21.3 paramiko 2.11.0 pip 21.1.2 pluggy 1.0.0 py 1.11.0 pycparser 2.21 pymongo 4.2.0 PyMySQL 1.0.2 PyNaCl 1.5.0 pyOpenSSL 22.0.0 pyparsing 3.0.9 PySocks 1.7.1 pytest 7.1.2 pytest-dependency 0.5.1 pytest-rerunfailures 10.2 PyYAML 6.0 redis 4.3.4 requests 2.28.1 requests-oauthlib 1.3.1 requests-toolbelt 0.9.1 selenium 4.3.0 setuptools 57.0.0 six 1.16.0 sniffio 1.2.0 sortedcontainers 2.4.0 tomli 2.0.1 trio 0.21.0 trio-websocket 0.9.2 typing-extensions 4.3.0 urllib3 1.26.11 websockets 10.3 wheel 0.36.2 wrapt 1.14.1 wsproto 1.1.0 xlrd 2.0.1 xlutils 2.0.0 xlwt 1.3.0

  • [ ] pytest and operating system versions pytest 7.1.2

OS 名称: Microsoft Windows 10 专业版 OS 版本: 10.0.18363 暂缺 Build 18363

  • [ ] minimal example if possible dir cases(conftest.py, test_one.py) run_all_cases.py

fireblackman avatar Aug 02 '22 09:08 fireblackman