summaryrefslogtreecommitdiff
path: root/pylint/test/regrtest_data/wrong_import_position.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-11-30 00:46:56 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2015-11-30 00:46:56 +0200
commita56f16b7a7e5b7b40a9d613e8cbec671a052f9e3 (patch)
tree442a49272532e2d8f0d00149772de90eda092920 /pylint/test/regrtest_data/wrong_import_position.py
parentb751e27cab545061149f1714e96449dfc1d60a9d (diff)
downloadpylint-a56f16b7a7e5b7b40a9d613e8cbec671a052f9e3.tar.gz
Add wrong-import-position to check_messages's decorator arguments for ImportChecker.leave_module
This fixes an esoteric bug which occurs when ungrouped-imports and wrong-import-order are disabled and pylint is executed on multiple files. What happens is that without wrong-import-position in check_messages, leave_module will never be called, which means that the first non-import node from other files might leak into the current file, leading to wrong-import-position being emitted by pylint.
Diffstat (limited to 'pylint/test/regrtest_data/wrong_import_position.py')
-rw-r--r--pylint/test/regrtest_data/wrong_import_position.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pylint/test/regrtest_data/wrong_import_position.py b/pylint/test/regrtest_data/wrong_import_position.py
new file mode 100644
index 0000000..9e2d099
--- /dev/null
+++ b/pylint/test/regrtest_data/wrong_import_position.py
@@ -0,0 +1,11 @@
+"""Test that wrong-import-position is properly reset when
+other errors are disabled.
+"""
+# pylint: disable=unused-import, too-few-public-methods
+
+
+class Something(object):
+ """A class before an import."""
+
+
+import os