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

fix: IsJson and IsUUID repr #109

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dirty_equals/_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, version: Literal[None, 1, 2, 3, 4, 5] = None):
```
"""
self.version = version
super().__init__(version or plain_repr('*'))
super().__init__(version or plain_repr(''))

def equals(self, other: Any) -> bool:
if isinstance(other, UUID):
Expand Down Expand Up @@ -109,7 +109,7 @@ def __init__(self, expected_value: JsonType = AnyJson, **expected_kwargs: Any):
self.expected_value: Any = expected_kwargs
else:
self.expected_value = expected_value
super().__init__(plain_repr('*') if expected_value is AnyJson else expected_value)
super().__init__(plain_repr('') if expected_value is AnyJson else expected_value)

def __class_getitem__(cls, expected_type: JsonType) -> IsJson[JsonType]:
return cls(expected_type)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_is_uuid_false_repr():
is_uuid = IsUUID()
with pytest.raises(AssertionError):
assert '123' == is_uuid
assert str(is_uuid) == 'IsUUID(*)'
assert str(is_uuid) == 'IsUUID()'


def test_is_uuid4_false_repr():
Expand All @@ -99,7 +99,7 @@ def test_is_json_any_false():
is_json = IsJson()
with pytest.raises(AssertionError):
assert 'foobar' == is_json
assert str(is_json) == 'IsJson(*)'
assert str(is_json) == 'IsJson()'


@pytest.mark.parametrize(
Expand Down
Loading