Allow assert_warns to match against multiple warnings.

Review Request #10774 — Created Nov. 1, 2019 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x
2f8e2eb...

Reviewers

Our TestCase.assert_warns method only worked when a single warning was
being emitted by code. There wasn't much reason for this, besides of
ease of implementation, and it made unit tests more fragile.

This change updates the function to check the provided warning
information against all emitted warnings, looking for a match. If none
are found, this will fail with an explicit error message.

Unit tests pass.

Made use of this in an upcoming unit test, which has to deal with multiple
warnings. It passed.