[New-bugs-announce] [issue29747] unittest - assertDoesNotRaise
Vinícius Dantas
report at bugs.python.org
Tue Mar 7 07:51:32 EST 2017
New submission from Vinícius Dantas:
Unittest provides us some assert methods, yet one is missing: the assertDoesNotRaise context.
When running tests, tests may end up as failures, successes or errors. It's worth noting that errors and failures are conceptually different, and that's the point on having an assertDoesNotRaise context, alike the assertRaises context.
This context would be useful, for example, when using Selenium client, it would be helpful to know if an alert popped, given there is no method to
check if there is an alert, we'd use a code like:
with assertDoesNotRaise(NoAlertPresentException):
driver.switch_to.alert.text
It is also important to mention that it makes explicit what we are testing. After all, explicit is better than implicit.
----------
components: Library (Lib)
messages: 289161
nosy: viniciusd
priority: normal
severity: normal
status: open
title: unittest - assertDoesNotRaise
type: enhancement
versions: Python 3.7
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29747>
_______________________________________
More information about the New-bugs-announce
mailing list