Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Closed
Description
In python!=
andis not
are two different things.
Right now the deprecation warning says!=
, let's see if that's true:
fromunittestimportTestCase,mainclassNothing:def__eq__(self,o):returnoisNoneclassTestExample(TestCase):deftest_method(self):n=Nothing()self.assertEqual(n,None)returnnmain()
It still raises this:
/Users/sobolev/Desktop/cpython/Lib/unittest/case.py:678: DeprecationWarning: It is deprecated to return a value!=None from a test case (<bound method TestExample.test_method of <__main__.TestExample testMethod=test_method>>) return self.run(*args, **kwds).----------------------------------------------------------------------Ran 1 test in 0.003sOK
I believe that this is misleading. The proper message should say:It is deprecated to return a value that is not None from a test case
I will send a PR with the fix.