Я использую фреймворк pytest для тестирования. Когда я запускаю файл test_abc.py, я увидел, что сначала выполняется pytest_configure, затем pytest_addoption...
Итак, мой вопрос: как мы можем узнать, что pytest_configure выполняется в начале и каков порядок выполнения остальных?
Вот мой файл conftest.py:
def pytest_addoption(parser):
print("pytest_addoption")
def pytest_exception_interact(
node: Union["Item", "Collector"],
call: "CallInfo[Any]",
report: Union["CollectReport", "TestReport"],
) -> None:
print("pytest exception interact")
def pytest_configure(config):
print("pytest configure")
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item):
print("pytest runtest makereport")
def pytest_runtest_setup(item):
print("pytest runtest setup")
def pytest_report_header(config):
print("pytest report header")```
Подробнее здесь: https://stackoverflow.com/questions/769 ... test-hooks