B
billiejoex
Hi there,
into a module of mine I 'warn' a message if a certain situation
occurs:
def add_anonymous_user(permissions=('r'):
if 'w' in p:
import warnings
warnings.warn("it's not rencommended assigning 'w'
permission to anonymous user.", RuntimeWarning, stacklevel=2)
I'd like to test such event from test suite ("fail test if warn is not
raised") but don't know how.
Any suggestion?
into a module of mine I 'warn' a message if a certain situation
occurs:
def add_anonymous_user(permissions=('r'):
if 'w' in p:
import warnings
warnings.warn("it's not rencommended assigning 'w'
permission to anonymous user.", RuntimeWarning, stacklevel=2)
I'd like to test such event from test suite ("fail test if warn is not
raised") but don't know how.
Any suggestion?