[issue9754] assertWarns and assertWarnsRegexp
report at bugs.python.org
Fri Sep 3 12:50:17 CEST 2010
New submission from Antoine Pitrou <pitrou at free.fr>:
Similar to assertRaises and assertRaisesRegexp, unittest should provide assertWarns and assertWarnsRegexp, to check that a given callable (or piece of code) triggers a particular warning.
Currently, you have to do that manually using a mixture of warnings.catch_warnings and warnings.filterwarnings, which is pretty annoying.
components: Library (Lib)
nosy: brett.cannon, michael.foord, pitrou
stage: needs patch
title: assertWarns and assertWarnsRegexp
type: feature request
versions: Python 3.2
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list