-
-
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
Document way to customize abbreviation (elipsis) on AssertionError #6682
Comments
|
One year later and I am facing again the same issue, a bug caused by an incomplete feature, one that cannot be disabled, the truncation. Can we please do something about it? For some projects this is testing PITA as the comparisons are almost always bigger than the limit and the user is left clueless to face the |
I think it was #8391 -- going to test it now. |
Oops yes, fixed my comment. |
@nicoddemus I think that we need to reopen this issue because current behavior is still not ok. I found multiple similar unanswered question online such https://stackoverflow.com/questions/38000993/how-can-i-get-my-assertions-in-pytest-to-stop-being-abbreviated-with-ellipsis IMHO, I think that we need to make these values configurable regardless of the verbosity level, especially as we know that changing general verbosity level has other side effects. My opinion is that most people would want to run in minimal verbosity level (especially) on ci but have verbose errors for failed tests. If I run in verbose by default displaying the console log in the browser can be problematic, true for github actions and also most CI/CD system I know (none behaves nice with very long console logs). |
@ssbarnea Check out https://docs.pytest.org/en/stable/reference/reference.html#confval-verbosity_assertions, added in pytest 8. |
@bluetech That issue seems to never want to be go away... :p --- I tried, still same output with ellipses, in fact even calling [tool.pytest.ini_options]
verbosity_assertions = 4
verbosity_test_cases = 4 Output:
Using latest 8.2.0. I put some breakpoints and tried to find what happens. Apparently the
|
I became sufficiently frustrated with this limitation that I'm currently porting some tests over to One of the many issues I encountered while trying to find a definitive answer on how to get native It also isn't clear whether any of the suggested workarounds affect the error summary report at the end of the test suite execution (that is getting truncated even when the tests are implemented in |
Seems like we just missed that case when more fine-grained verbosity levels were added. Fixes pytest-dev#6682
Seems like we just missed that case when more fine-grained verbosity levels were added. Fixes pytest-dev#6682
Sorry folks, seems we dropped the ball on this one. Opened #12662 with a proposed fix. |
Thanks @nicoddemus! I agree that combined with the previous reference to https://docs.pytest.org/en/stable/reference/reference.html#confval-verbosity_assertions that change should cover both this issue and #12307 |
…12687) Seems like we just missed that case when more fine-grained verbosity levels were added. Fixes #6682, #12307 (cherry picked from commit bc1e17e) Co-authored-by: Bruno Oliveira <[email protected]>
I keep getting errors that I cannot debug because the printed
AssertionError
is censored so much that makes impossible to see what was the difference.Adding
-vvvv
did not help at all changing the way exceptions are rendered.I did try to research the subject a lot online but I was not able to find any solution that would allow me to disable or customize when abbreviation happens, to make the limit upwards.
I raised this to PyTest because I am looking for a solution that can enable this at the entire test-suite and not on a specific file with tests, being able to do it globally is key for big projects.
Some resources I found:
The text was updated successfully, but these errors were encountered: