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

Is there a way to see in the test report the assertion failure for each subtest? #9

Open
fbarbu15 opened this issue Apr 4, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@fbarbu15
Copy link

fbarbu15 commented Apr 4, 2019

I'm running 2 tests that have several subtests failing and I can see all the asserts failing in the console output in jenkins. However when I'm looking in the test report for each failed tests I see only the first assertion failures and for the next ones I see something like this ..........\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]

See the report for one of my tests:

Failed
WORK_DIR.cop_regression.tests.test_main_window.TestMainWindow.test_04_new_contact_by_main_window (from pytest)
Failing for the past 8 builds (Since Failed#20 )
Took 10 sec.
add description
Error Message
AssertionError: 1 not greater than or equal to 2 : Value 102 for field CustNo not present in the receiver address window. Check field selector
Stacktrace
C:\WORK_DIR\cop_regression\tests\test_base.py:296: in __soft_assert_greater_or_equal
    self.assertGreaterEqual(a, b, msg)
E   AssertionError: 1 not greater than or equal to 2 : Value 102 for field CustNo not present in the receiver address window. Check field selector
Standard Output
FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]
..\..\..\..\..\WORK_DIR\cop_regression\tests\test_main_window.py::TestMainWindow::test_04_new_contact_by_main_window FAILED [100%]

I've added the all xml as well.

test_report.docx

The command to run the tests is: pytest --junitxml=test_main_window.xml -v C:\WORK_DIR\cop_regression\tests\test_main_window.py
Thanks for looking into this

@nicoddemus
Copy link
Member

Hi @fbarbu15,

Thanks for the feedback!

Indeed we need better integration with the junitxml plugin. This is also related to #6 and pytest-dev/pytest#5047, so it will probably need at least a new pytest release (4.5) before we have enough flexibility to implement this. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants