Skip to content
Merged
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
14 changes: 7 additions & 7 deletions src/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def message(self) -> str:
assert isinstance(self, TestgresException)
r = super().__str__()
assert r is not None
assert type(r) == str # noqa: E721
assert type(r) is str
return r

@property
Expand All @@ -18,7 +18,7 @@ def source(self) -> typing.Optional[str]:

def __str__(self) -> str:
r = self.message
assert type(r) == str # noqa: E721
assert type(r) is str
return r


Expand All @@ -27,21 +27,21 @@ class InvalidOperationException(TestgresException):
_source: typing.Optional[str]

def __init__(self, message: str, source: typing.Optional[str] = None):
assert type(message) == str # noqa: E721
assert source is None or type(source) == str # noqa: E721
assert type(message) is str
assert source is None or type(source) is str
super().__init__()
self._message = message
self._source = source
return

@property
def message(self) -> str:
assert type(self._message) == str # noqa: E721
assert type(self._message) is str
return self._message

@property
def source(self) -> str:
assert self._source is None or type(self._source) == str # noqa: E721
assert self._source is None or type(self._source) is str
return self._source

def __repr__(self) -> str:
Expand All @@ -52,5 +52,5 @@ def __repr__(self) -> str:
repr(self._message),
repr(self._source),
)
assert type(r) == str # noqa: E721
assert type(r) is str
return r