-
Notifications
You must be signed in to change notification settings - Fork 346
No obvious way to set self.maxDiff
with pytest_django.asserts
#1155
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hmm, thanks for the issue. I figure we should plumb the pytest verbosity options into |
Looked into it. Unfortunately what the way |
From looking at the source, it looks like a pytest-django/pytest_django/asserts.py Line 25 in d8dc3d9
Is it not possible at this location to check some global configuration, e.g. the pytest verbosity? |
We can temporarily monkey-patch this in # top of conftest.py
import unittest
unittest.TestCase.maxDiff = None
# ... all other imports here |
What do you guys think of my naive approach #1191 |
Looks good IMO, but to be honest, I would prefer that this goes to a configuration file (like |
What would that look like @roniemartinez?
|
Something like that. But would consult with a Pytest dev since this is for EDIT: This is related to unittest.TestCase and not pytest-django. It requires a proper input from a Pytest dev. |
When using
pytest_django.asserts.assertXMLEqual
, the diff in the console is truncated, with the following message at the end:It's not obvious to me what the right way to accomplish this with pytest-django is, since the
TestCase
for these functions is defined internally. Right now I'm just monkeypatchingunittest.case.TestCase.maxDiff
, but it'd be nice to have an obvious way of doing this.The text was updated successfully, but these errors were encountered: