Skip to content

Commit

Permalink
fix: IsJson and IsUUID repr
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Sep 18, 2024
1 parent 065162a commit dac75d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit dac75d1

Please sign in to comment.