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 <rep...@bugs.python.org>
<http://bugs.python.org/issue29747>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to