backport: #20145: assert[Raises|Warns]Regex now raise TypeError on bad regex.

Previously a non-string, non-regex second argument and missing callable
argument could cause the test to appear to always pass.

Initial patch by Kamilla Holanda.
4 files changed