summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-03-23 19:08:43 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-03-23 19:08:43 (GMT)
commite1b6f97daedcfab29c1139ddb8c41292cd7de472 (patch)
tree580920419e1db0b677444a7fb33201d44f32b114 /Doc/whatsnew
parent91e7f04fc55523b339209dc6fb7702d3cf6bade4 (diff)
downloadcpython-e1b6f97daedcfab29c1139ddb8c41292cd7de472.zip
cpython-e1b6f97daedcfab29c1139ddb8c41292cd7de472.tar.gz
cpython-e1b6f97daedcfab29c1139ddb8c41292cd7de472.tar.bz2
#20145: assert[Raises|Warns]Regex now raise TypeError on bad regex.
Previously a non-string, non-regex second argument could cause the test to always pass. Initial patch by Kamilla Holanda.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.5.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst
index b18bcd2..2447898 100644
--- a/Doc/whatsnew/3.5.rst
+++ b/Doc/whatsnew/3.5.rst
@@ -192,3 +192,9 @@ that may require changes to your code.
if it represented midnight in UTC. This behavior was considered obscure and
error-prone and has been removed in Python 3.5. See :issue:`13936` for full
details.
+
+* :meth:`unittest.TestCase.assertRaisesRegex` and
+ :meth:`~unittest.TestCase.assertWarnsRegex` now raise a :exc:`TypeError` if
+ the second argument is not a string or a compiled :mod:`regex`. You may have
+ tests with an invalid second argument that have until 3.5 been falsely
+ passing which will now raise TypeErrors (:issue:`20145`).