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 barry
Recipients barry, brett.cannon, exarkun, pitrou
Date 2008-09-06.17:03:17
SpamBayes Score 0.00017586979
Marked as misclassified No
Message-id <>
I hate to make API suggestions this late in the process, but this is the
time I've looked at this.  I think the basic problem is that the context
manager API is a bit weird.  What I don't like is the fact that
indexes the last item in the WarningsRecorder.  I don't know the history
but why wouldn't this be a better API?

    with catch_warnings(True) as w:
        assert len(w) > 0, 'No caught warnings'
        assert str(w[-1].message) == 'foo', 'blah blah'
Date User Action Args
2008-09-06 17:03:18barrysetrecipients: + barry, brett.cannon, exarkun, pitrou
2008-09-06 17:03:18barrysetmessageid: <>
2008-09-06 17:03:17barrylinkissue3781 messages
2008-09-06 17:03:17barrycreate