diff options
author | Cezar <devnull@localhost> | 2015-09-20 14:01:13 +0300 |
---|---|---|
committer | Cezar <devnull@localhost> | 2015-09-20 14:01:13 +0300 |
commit | 74909ef6e085ff71392327152889d1459bf5f733 (patch) | |
tree | ac1e5522735f253b806f55d09695e4fd06e8fa3f | |
parent | 18087cd485d8cc7d9fd834e57e843c31a4a95f8b (diff) | |
download | pylint-74909ef6e085ff71392327152889d1459bf5f733.tar.gz |
Update functional tests for deprecated methods
-rw-r--r-- | pylint/test/functional/deprecated_methods.py | 18 | ||||
-rw-r--r-- | pylint/test/functional/deprecated_methods.txt | 4 | ||||
-rw-r--r-- | pylint/test/functional/duplicate_dict_literal_key.py | 6 | ||||
-rw-r--r-- | pylint/test/functional/duplicate_dict_literal_key.txt | 2 | ||||
-rw-r--r-- | pylint/test/functional/logging_not_lazy.py | 8 |
5 files changed, 30 insertions, 8 deletions
diff --git a/pylint/test/functional/deprecated_methods.py b/pylint/test/functional/deprecated_methods.py new file mode 100644 index 0000000..3446f75 --- /dev/null +++ b/pylint/test/functional/deprecated_methods.py @@ -0,0 +1,18 @@ +""" Functional tests for method deprecation. """ +# pylint: disable=missing-docstring +import html.parser +import unittest +import distutils +import xml.etree.ElementTree + +html.parser.unescape('a') # [deprecated-method] + + +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] diff --git a/pylint/test/functional/deprecated_methods.txt b/pylint/test/functional/deprecated_methods.txt new file mode 100644 index 0000000..2e0a076 --- /dev/null +++ b/pylint/test/functional/deprecated_methods.txt @@ -0,0 +1,4 @@ +deprecated-method:8::Using deprecated method unescape() +deprecated-method:13:MyTest.test:Using deprecated method assert_() +deprecated-method:16::Using deprecated method check_metadata() +deprecated-method:18::Using deprecated method getchildren() diff --git a/pylint/test/functional/duplicate_dict_literal_key.py b/pylint/test/functional/duplicate_dict_literal_key.py index f74e10e..6c9f933 100644 --- a/pylint/test/functional/duplicate_dict_literal_key.py +++ b/pylint/test/functional/duplicate_dict_literal_key.py @@ -1,13 +1,13 @@ """Check multiple key definition""" -#pylint: disable=C0103 +# pylint: disable=C0103 correct_dict = { 'tea': 'for two', 'two': 'for tea', } -wrong_dict = { # [duplicate-key] - 'tea': 'for two', +wrong_dict = { + 'tea': 'for two', # [duplicate-key] 'two': 'for tea', 'tea': 'time', diff --git a/pylint/test/functional/duplicate_dict_literal_key.txt b/pylint/test/functional/duplicate_dict_literal_key.txt index 9780480..fda20cb 100644 --- a/pylint/test/functional/duplicate_dict_literal_key.txt +++ b/pylint/test/functional/duplicate_dict_literal_key.txt @@ -1 +1 @@ -duplicate-key:9::Duplicate key 'tea' in dictionary +duplicate-key:10::Duplicate key 'tea' in dictionary diff --git a/pylint/test/functional/logging_not_lazy.py b/pylint/test/functional/logging_not_lazy.py index ccc8665..b843431 100644 --- a/pylint/test/functional/logging_not_lazy.py +++ b/pylint/test/functional/logging_not_lazy.py @@ -1,13 +1,13 @@ -# pylint: disable=missing-docstring,no-member +# pylint: disable=missing-docstring,no-member,deprecated-method # Muck up the names in an effort to confuse... import logging as renamed_logging import os as logging # Statements that should be flagged: -renamed_logging.warn('%s, %s' % (4, 5)) # [logging-not-lazy] -renamed_logging.exception('%s' % 'Exceptional!') # [logging-not-lazy] -renamed_logging.log(renamed_logging.INFO, 'msg: %s' % 'Run!') # [logging-not-lazy] +renamed_logging.warn('%s, %s' % (4, 5)) # [logging-not-lazy] +renamed_logging.exception('%s' % 'Exceptional!') # [logging-not-lazy] +renamed_logging.log(renamed_logging.INFO, 'msg: %s' % 'Run!') # [logging-not-lazy] # Statements that should not be flagged: renamed_logging.warn('%s, %s', 4, 5) |