Message249048
There was a discussion/patch in #9754 [1].
This allows for multiple warning types as a tuple, e.g.;
self.assertWarnsRegex((DeprecationWarning, RuntimeWarning), "^E1000:")
However, it does not allow testing for multiple warning messages, e.g.;
expect = ((UserWarning, "^W1000"), (UserWarning, "^W1001"))
self.assertWarnsRegex(*expect)
This is slightly unexpected, as `test.support.check_warnings` allows this behaviour, e.g.
expect = ((UserWarning, "^W1000"), (UserWarning, "^W1001"))
check_warnings(*expect)
Therefore I am proposing that `assertWarnsRegex` and `assertWarns` are modified to reflect the behaviour of `check_warnings`, whilst ensuring backwards compatibility. (e.g. if arg[0] is tuple, use new approach, otherwise use old approach).
[1]: http://bugs.python.org/issue9754 |
|
Date |
User |
Action |
Args |
2015-08-24 14:15:48 | sleepycal | set | recipients:
+ sleepycal |
2015-08-24 14:15:48 | sleepycal | set | messageid: <1440425748.63.0.780438690591.issue24922@psf.upfronthosting.co.za> |
2015-08-24 14:15:48 | sleepycal | link | issue24922 messages |
2015-08-24 14:15:47 | sleepycal | create | |
|