Skip to content

Commit

Permalink
Remove unnecessary casts.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunns authored and offbyone committed Mar 2, 2020
1 parent f849bd3 commit 71acb72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hamcrest/core/core/raises.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _call_function(self, function: Callable[..., Any]) -> bool:
except BaseException:
self.actual = sys.exc_info()[1]

if isinstance(self.actual, cast(type, self.expected)):
if isinstance(self.actual, self.expected):
if self.pattern is not None:
if re.search(self.pattern, str(self.actual)) is None:
return False
Expand All @@ -65,7 +65,7 @@ def describe_mismatch(self, item, description: Description) -> None:

if self.actual is None:
description.append_text("No exception raised.")
elif isinstance(self.actual, cast(type, self.expected)):
elif isinstance(self.actual, self.expected):
if self.pattern is not None or self.matcher is not None:
description.append_text("Correct assertion type raised, but ")
if self.pattern is not None:
Expand Down

0 comments on commit 71acb72

Please sign in to comment.