Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest_runtest_logstart and pytest_runtest_logfinish are not in effect #31

Closed
wy-z opened this issue Apr 29, 2020 · 2 comments · Fixed by #46
Closed

pytest_runtest_logstart and pytest_runtest_logfinish are not in effect #31

wy-z opened this issue Apr 29, 2020 · 2 comments · Fixed by #46

Comments

@wy-z
Copy link

wy-z commented Apr 29, 2020

pytest-forked reimplemented pytest_runtest_protocol, but pytest_runtest_logstart and pytest_runtest_logfinish were ignored.

Here are the codes in pytest-forked and pytest:

def pytest_runtest_protocol(item):
if item.config.getvalue("forked") or item.get_closest_marker("forked"):
reports = forked_run_report(item)
for rep in reports:
item.ihook.pytest_runtest_logreport(report=rep)
return True

https://github.com/pytest-dev/pytest/blob/259e5d0610202453f9beace6cab336b11d4353a9/src/_pytest/runner.py#L87
image

@wy-z
Copy link
Author

wy-z commented Apr 29, 2020

How about implementing pytest_runtest_logstart and pytest_runtest_logfinish in pytest_runtestloop instead of in pytest_runtest_protocol? @nicoddemus
https://github.com/pytest-dev/pytest/blob/4f8fff9cab6e2333890e21eb840724e7e4d41763/src/_pytest/main.py#L260-L277
image

@webknjaz
Copy link
Member

webknjaz commented Jul 2, 2020

@wy-z this library is in maintenance mode. It is unlikely that the maintainers will implement your request but if you want to send a PR — feel free. Just make sure that it's well-covered by tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants