summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2018-09-29 11:23:05 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2018-09-29 11:23:05 +0200
commit48a45e1c68dfaa03665d47392bca4d6abec625bc (patch)
treef075d5de38221a56219414e244aef08e236fa850
parentb8f04a0b59aa699bd3600b815b495794096d59db (diff)
downloadpylint-git-48a45e1c68dfaa03665d47392bca4d6abec625bc.tar.gz
Add test case that deprecated method is emitted for unittest methods. Close #2226
-rw-r--r--pylint/test/functional/deprecated_methods_py3.py10
-rw-r--r--pylint/test/functional/deprecated_methods_py3.txt5
2 files changed, 15 insertions, 0 deletions
diff --git a/pylint/test/functional/deprecated_methods_py3.py b/pylint/test/functional/deprecated_methods_py3.py
index 54bbd242c..6ee7a831c 100644
--- a/pylint/test/functional/deprecated_methods_py3.py
+++ b/pylint/test/functional/deprecated_methods_py3.py
@@ -35,3 +35,13 @@ class SuperCrash(unittest.TestCase):
super(SuperCrash, self)()
xml.etree.ElementTree.iterparse(None)
+
+
+class Tests(unittest.TestCase):
+
+ def test_foo(self):
+ self.assertEquals(2 + 2, 4) # [deprecated-method]
+ self.assertNotEquals(2 + 2, 4) # [deprecated-method]
+ self.assertAlmostEquals(2 + 2, 4) # [deprecated-method]
+ self.assertNotAlmostEquals(2 + 2, 4) # [deprecated-method]
+ self.assert_("abc" == "2") # [deprecated-method]
diff --git a/pylint/test/functional/deprecated_methods_py3.txt b/pylint/test/functional/deprecated_methods_py3.txt
index 19c24bdc4..ad588341d 100644
--- a/pylint/test/functional/deprecated_methods_py3.txt
+++ b/pylint/test/functional/deprecated_methods_py3.txt
@@ -9,3 +9,8 @@ deprecated-method:25::Using deprecated method popen()
deprecated-method:26::Using deprecated method encodestring()
deprecated-method:27::Using deprecated method decodestring()
deprecated-method:28::Using deprecated method escape()
+deprecated-method:43:Tests.test_foo:Using deprecated method assertEquals()
+deprecated-method:44:Tests.test_foo:Using deprecated method assertNotEquals()
+deprecated-method:45:Tests.test_foo:Using deprecated method assertAlmostEquals()
+deprecated-method:46:Tests.test_foo:Using deprecated method assertNotAlmostEquals()
+deprecated-method:47:Tests.test_foo:Using deprecated method assert_()