pytest-dev / pytest-dev/pytest-xdist
pytest_runtest_logreport logs not showing
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 287
- Avg merge
- 9h 30m
- Merged PRs (30d)
- 2
Description
Hi,
I'm currently struggling with pytest_runtest_logreport. We're using pytest-xdist 2.5.0 and python 3.7. I am running the tests on my local machine, MacOS 10.15.
I have a test suite, and have added the below code to my conftest.py :
def pytest_runtest_logreport(report):
"""
This is called 3 times per test, once for each phase: setup/call/teardown
"""
if report and report.when and report.when == 'call':
print("pytest_runtest_logreport - Test %s had outcome: %s - Did pass? %s"
% (report.nodeid, report.outcome, report.passed))
When I run a test "manually in Pycharm, by clicking the little green arrow next to a test, I can see the log out put just fine.
However, when I run python -m pytest -n 2 --dist loadgroup then my tests do run and I can see some logs form the run, but nothing from pytest_runtest_logreport
Other details: I am running a local Selenium Grid using Docker, so the web_driver uses http://localhost:4444/wd/hub to communicate with the grid. That seems to be working fine.
Is there something I'm missing somewhere ?
Thanks
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the pytest_runtest_logreport hook in conftest.py and reproduce the issue using python -m pytest -n 2 --dist loadgroup, comparing it with the manual PyCharm run. Trace whether the hook output is emitted during pytest-xdist execution; done means the hook's call-phase logs are visible or the issue documents the execution limitation and workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100