summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-09-21 10:00:45 +0000
committerClaudiu Popa <pcmanticore@gmail.com>2015-09-21 10:00:45 +0000
commitb29b4b2eb3b612adfeae738a27a419a7803a399f (patch)
tree1f0f071a5b78a3c69068f4bff288586971aa8461
parentb7395864a9ac5d37b50be519b462854bf3641f36 (diff)
parentc167eaa1a0752f97322490a92b8f2bc4e8531812 (diff)
downloadpylint-b29b4b2eb3b612adfeae738a27a419a7803a399f.tar.gz
Merged in palazzem/pylint (pull request #271)
fixed _check_deprecated_method during pylint linting
-rw-r--r--pylint/checkers/stdlib.py2
-rw-r--r--pylint/test/functional/deprecated_methods_py2.py6
-rw-r--r--pylint/test/functional/deprecated_methods_py3.py21
-rw-r--r--pylint/test/functional/deprecated_methods_py3.rc2
-rw-r--r--pylint/test/functional/deprecated_methods_py3.txt16
5 files changed, 35 insertions, 12 deletions
diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py
index c262c2c..02d3689 100644
--- a/pylint/checkers/stdlib.py
+++ b/pylint/checkers/stdlib.py
@@ -177,7 +177,7 @@ class StdlibChecker(BaseChecker):
'inspect.getmoduleinfo', 'inspect.getmodulename',
'logging.warn', 'logging.Logger.warn',
'logging.LoggerAdapter.warn',
- 'nntplib.NNTPBase.xpath',
+ 'nntplib._NNTPBase.xpath',
'platform.popen',
],
(3, 4): [
diff --git a/pylint/test/functional/deprecated_methods_py2.py b/pylint/test/functional/deprecated_methods_py2.py
index 3b3d25a..ceba1e4 100644
--- a/pylint/test/functional/deprecated_methods_py2.py
+++ b/pylint/test/functional/deprecated_methods_py2.py
@@ -3,7 +3,7 @@
import os
import xml.etree.ElementTree
-os.popen2() # [deprecated-method]
-os.popen3() # [deprecated-method]
-os.popen4() # [deprecated-method]
+os.popen2('') # [deprecated-method]
+os.popen3('') # [deprecated-method]
+os.popen4('') # [deprecated-method]
xml.etree.ElementTree.Element('elem').getchildren() # [deprecated-method]
diff --git a/pylint/test/functional/deprecated_methods_py3.py b/pylint/test/functional/deprecated_methods_py3.py
index 1a5fbf0..214964b 100644
--- a/pylint/test/functional/deprecated_methods_py3.py
+++ b/pylint/test/functional/deprecated_methods_py3.py
@@ -1,7 +1,12 @@
""" Functional tests for method deprecation. """
# pylint: disable=missing-docstring
+import base64
+import cgi
+import inspect
+import logging
+import nntplib
+import platform
import unittest
-import distutils
import xml.etree.ElementTree
@@ -9,7 +14,15 @@ class MyTest(unittest.TestCase):
def test(self):
self.assert_(True) # [deprecated-method]
-REG = distutils.command.register.register('a')
-REG.check_metadata() # [deprecated-method]
-
xml.etree.ElementTree.Element('tag').getchildren() # [deprecated-method]
+xml.etree.ElementTree.Element('tag').getiterator() # [deprecated-method]
+xml.etree.ElementTree.XMLParser('tag', None, None).doctype(None, None, None) # [deprecated-method]
+nntplib.NNTP(None).xpath(None) # [deprecated-method]
+inspect.getmoduleinfo(inspect) # [deprecated-method]
+inspect.getmodulename(inspect) # [deprecated-method]
+inspect.getargspec(None) # [deprecated-method]
+logging.warn("a") # [deprecated-method]
+platform.popen([]) # [deprecated-method]
+base64.encodestring("42") # [deprecated-method]
+base64.decodestring("42") # [deprecated-method]
+cgi.escape("a") # [deprecated-method]
diff --git a/pylint/test/functional/deprecated_methods_py3.rc b/pylint/test/functional/deprecated_methods_py3.rc
index c093be2..28c99bc 100644
--- a/pylint/test/functional/deprecated_methods_py3.rc
+++ b/pylint/test/functional/deprecated_methods_py3.rc
@@ -1,2 +1,2 @@
[testoptions]
-min_pyver=3.0
+min_pyver=3.3
diff --git a/pylint/test/functional/deprecated_methods_py3.txt b/pylint/test/functional/deprecated_methods_py3.txt
index 8e9516c..29a2ce8 100644
--- a/pylint/test/functional/deprecated_methods_py3.txt
+++ b/pylint/test/functional/deprecated_methods_py3.txt
@@ -1,3 +1,13 @@
-deprecated-method:10:MyTest.test:Using deprecated method assert_()
-deprecated-method:13::Using deprecated method check_metadata()
-deprecated-method:15::Using deprecated method getchildren()
+deprecated-method:15:MyTest.test:Using deprecated method assert_()
+deprecated-method:17::Using deprecated method getchildren()
+deprecated-method:18::Using deprecated method getiterator()
+deprecated-method:19::Using deprecated method doctype()
+deprecated-method:20::Using deprecated method xpath()
+deprecated-method:21::Using deprecated method getmoduleinfo()
+deprecated-method:22::Using deprecated method getmodulename()
+deprecated-method:23::Using deprecated method getargspec()
+deprecated-method:24::Using deprecated method warn()
+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()