Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 71acb72

Browse files
brunnsoffbyone
authored andcommitted
Remove unnecessary casts.
1 parent f849bd3 commit 71acb72

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/hamcrest/core/core/raises.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _call_function(self, function: Callable[..., Any]) -> bool:
3939
except BaseException:
4040
self.actual = sys.exc_info()[1]
4141

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

6666
if self.actual is None:
6767
description.append_text("No exception raised.")
68-
elif isinstance(self.actual, cast(type, self.expected)):
68+
elif isinstance(self.actual, self.expected):
6969
if self.pattern is not None or self.matcher is not None:
7070
description.append_text("Correct assertion type raised, but ")
7171
if self.pattern is not None:

0 commit comments

Comments
 (0)