From 669c9428d8fa9c11964aa97d7fbb080701de629a Mon Sep 17 00:00:00 2001 From: chenaidong1 Date: Thu, 4 May 2017 10:05:46 +0800 Subject: [PATCH] Use assertIsNone(...) instead of assertEqual(None, ...). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ref£º http://docs.openstack.org/developer/hacking/#real-world-import-order-examples [H203] Use assertIs(Not)None to check for None (off by default) Unit test assertions tend to give better messages for more specific assertions. As a result, assertIsNone(...) is preferred over assertEqual(None, ...) and assertIs(None, ...), and assertIsNotNone(...) is preferred over assertNotEqual(None, ...) and assertIsNot(None, ...). Change-Id: Idcf78fce02b01c41816a34efcb1264d69ce71706 --- magnumclient/tests/test_shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magnumclient/tests/test_shell.py b/magnumclient/tests/test_shell.py index eb18fd3..2581e98 100644 --- a/magnumclient/tests/test_shell.py +++ b/magnumclient/tests/test_shell.py @@ -85,7 +85,7 @@ class ShellTest(utils.TestCase): def test_positive_non_zero_float(self): output = magnumclient.shell.positive_non_zero_float(None) - self.assertEqual(None, output) + self.assertIsNone(output) output = magnumclient.shell.positive_non_zero_float(5) self.assertEqual(5, output)