This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sleepycal
Recipients sleepycal
Date 2015-08-24.14:15:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440425748.63.0.780438690591.issue24922@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2015-08-24 14:15:48sleepycalsetrecipients: + sleepycal
2015-08-24 14:15:48sleepycalsetmessageid: <1440425748.63.0.780438690591.issue24922@psf.upfronthosting.co.za>
2015-08-24 14:15:48sleepycallinkissue24922 messages
2015-08-24 14:15:47sleepycalcreate