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

Always compare object mappings when ignore_eq is enabled. #137

Merged
merged 1 commit into from Sep 4, 2020

Conversation

gdlg
Copy link
Contributor

@gdlg gdlg commented Sep 4, 2020

The object comparer indirectly relies on the __eq__ method of attributes in the check x_attrs != y_attrs even when ignore_eq is set.

This PR changes it to always compare the mappings when ignore_eq is enabled. I have also created a test case using the OrmObj object.

The test_compare.py passes on its own; however when I installed Django to run the other tests; I ran into this error using pytest testfixtures/tests/test_django/test_compare.py:

E   django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

I am not sure how to run the tests properly.

@cjw296
Copy link
Member

cjw296 commented Sep 4, 2020

This is a really nice find, thanks! What a nasty edge case bug...

@cjw296 cjw296 merged commit 518089c into simplistix:master Sep 4, 2020
@cjw296
Copy link
Member

cjw296 commented Sep 4, 2020

https://pypi.org/project/testfixtures/6.14.2/ is out now with the fix, thanks again!

@gdlg
Copy link
Contributor Author

gdlg commented Sep 4, 2020

@cjw296 So quick to update the pip package! Thank you very much :-)

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

Successfully merging this pull request may close these issues.

None yet

2 participants