From 26d27df6fce16904ed9fb27e27e16dc9620d9569 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 30 Oct 2018 16:15:03 -0300 Subject: [PATCH] Improve changelog message --- changelog/3191.feature.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/changelog/3191.feature.rst b/changelog/3191.feature.rst index 3eedf8dfc..d62301a0c 100644 --- a/changelog/3191.feature.rst +++ b/changelog/3191.feature.rst @@ -1 +1,11 @@ -Add warning when asserting ``None`` directly +A warning is now issued when assertions are made directly against ``None``. + +This is a common source of confusion among new users, which write:: + + assert mocked_object.assert_called_with(3, 4, 5, key='value') + +When they should write:: + + mocked_object.assert_called_with(3, 4, 5, key='value') + +Because the ``assert_called_with`` method of mock objects already executes an assertion.