-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
the report of the failed subtest is not generated if when='call' #10491
Comments
Hi @anb76ru - I've edited your issue a little to clarify the report and use I can't comment directly on this code, but you don't need permissions to create a branch in this repo in order to contribute: the standard open-source workflow is to create your own copy ("fork"), make a branch in that, and then open an pull request ("PR"). This quickstart guide is pretty good, and Pytest maintainers are generally happy to have further discussion about proposed changes on the pull request. |
Hello Zac-HD, thank you very much. I figured out how to do PR |
@anb76ru can you explain exactly, from a users' perspective, what is the current behavior, and what you want to achieve? I would like to have a better use case description (you post what changes you want in pytest's code, but not the behavior you want to see exactly). I ask because I thought I interpreted the use case before, but now I'm not so sure after rereading the issue. |
@nicoddemus, OK. I'll try to explain. As a rule, in subtests i checking layout. I want see stdout for subtests. However, if subtests is failed, report is not generated. Like as If I will be generated subtests report for |
Glad I asked. 😅 I had understood somewhat differently, you did mention "subtests" and "report", and pointed to the code in Really sorry for wasting your time working on the PR, but this is a duplicate of pytest-dev/pytest-subtests#9. While it seems like your PR might fix it, I'm hesitant of applying this change into pytest: I think the junitxml's hook needs to be refactored to account for multiple calls of I would prefer to fix the issue once we integrate So unfortunately I think we will need to close this, along with #10496, and get to this once we integrate Again, sorry for not realizing/asking for the real use case sooner, hope you understand. Thanks! |
@nicoddemus, Thanks for feedback |
Hello! I use the
pytest_runtest_logreport
method to get subtest reports. A report is generated forwhen='call'
, but if the test failed, thereport
is not generated. I think this is because thelog_passing_tests=True
attribute is used in theelif report.failed:
block. If the test failed, then ifwhen == 'call'
we don't step into the code block:and the report is not generated. I don't understand why
self.log_passing_test using
inreport.failed
. Maybe this is a mistake. If you remove the 'if not self.log_passing_tests: ', then the report for the failed tests forwhen='call'
is generated without problems.OS: win10
pytest_ver: 7.1.1
I suggest making
reporter.write_captured_output(report)
unconditional, but I don't have the rights to create my own branch.The text was updated successfully, but these errors were encountered: