We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 411e695 commit d0800b3Copy full SHA for d0800b3
playwright/_impl/_assertions.py
@@ -1017,14 +1017,13 @@ def __exit__(
1017
__tracebackhide__ = True
1018
1019
if self._context.has_failures():
1020
- if exc_type is not None:
+ if exc_type is not None and exc_val is not None:
1021
failure_message = (
1022
f"{str(exc_val)}"
1023
f"\n\nThe above exception occurred within soft assertion block."
1024
f"\n\nSoft assertion failures:\n{self._context.get_failure_messages()}"
1025
)
1026
- if exc_val is not None:
1027
- exc_val.args = (failure_message,) + exc_val.args[1:]
+ exc_val.args = (failure_message,) + exc_val.args[1:]
1028
return
1029
1030
raise AssertionError(
0 commit comments