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_makereport is not giving the report result with xdist #786
Comments
With xdist print does not work, what's your output /expected output? |
actually i am asking about result = outcome.get_result() method ,which is not giving report data retalted to Testcase name Status passed and failed. i am using the below method to get the result data by using result=outcome.get_result() as follow: |
With a partial badly formatted code example and no expected vs actual output, the only thing i can vaguely guess is that print does not work on xdist For anything else please provide enough detail to work with |
No im not asking about print statement.i need complete report summary after excecuting the below code with xdist:
the above result = outcome.get_result() marked stament is not working fine with xdist.here is the formatted code |
It's unclear what you mean by not working The posted code is unaware of xdist and likely broken as each worker makes a own summary with that |
my question is that how to get the consolidated pass/fail report with tetscasename from each worker node . |
For that case i recommend that you use the logreport hook only on the coordination and skip doing any on the workers |
logreport hook generate the Log file of test summary report? |
u mean to say like this:
|
Kinda |
so one more question can i achive this by worked node.and collect all the report data from all worked nodes. |
It's not clear what you are asking for, there are no built-in summary combination hooks and your presented use case is fine to run on the coordinator |
actully i need to generate the html test summary report which conatin pass,fail,Total test cases.
so My problem is that when ran my test using xdist.i need to colect the consolidate result of all worker Node.that t can generate the su,mary report.with pass fail percentage. |
Using the logreport hook on the coordinator will automatically bring it together |
logreport generate the Html report by default.or i need to implement the logic inside the logreport hook for html reporting.?? |
HI @RonnyPfannschmidt here is the code implementation:
|
i m closing my issue. |
platform window
Python 3.9.9
pytest-7.1.2
pluggy-1.0.0
plugins: xdist-2.5.0, forked-1.4.0
I have a scenarioes after executing all the test cases with xdist.i need to colloect the report with pytest_runtest_makereport
as follw:
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(self,item, call):
outcome = yield
result = outcome.get_result()
print('makereport:', result)
if result.when == 'call':
item.session.results[item] = result
but result = outcome.get_result() is not giving any result with xdist.without xdist it is working fine.
The text was updated successfully, but these errors were encountered: