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

AnyThing() full diff #108

Open
NewSouthMjos opened this issue Sep 15, 2024 · 0 comments
Open

AnyThing() full diff #108

NewSouthMjos opened this issue Sep 15, 2024 · 0 comments

Comments

@NewSouthMjos
Copy link

I have question related to how Anything presented in full diff, when test failed.

from dirty_equals import AnyThing

def test_dirty_equals_1():
    leftdct = {"id": 1, "name": "AAA", "anything": [1, 2, 3]}
    rightdct = {"id": 1, "name": "BBB", "anything": AnyThing()}
    assert leftdct == rightdct

now gives:

FAILED tests::test_dirty_equals_1 - AssertionError: assert {'id': 1, 'name': 'AAA', 'anything': [1, 2, 3]} == {'id': 1, 'name': 'BBB', 'anything': AnyThing()}
  
  Common items:
  {'anything': [1, 2, 3], 'id': 1}
  Differing items:
  {'name': 'AAA'} != {'name': 'BBB'}
  
  Full diff:
    {
  -     'anything': [1, 2, 3],
  ?                  ---------
  +     'anything': [
  +         1,
  +         2,
  +         3,
  +     ],
        'id': 1,
  -     'name': 'BBB',
  ?              ^^^
  +     'name': 'AAA',
  ?              ^^^
    }

Is there a proper way to deal with Anything, so it wont be included in fill diff?

@NewSouthMjos NewSouthMjos changed the title Anything full diff AnyThing() full diff Sep 16, 2024
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

No branches or pull requests

1 participant