diff options
Diffstat (limited to 'pylint/test')
-rw-r--r-- | pylint/test/functional/wrong_import_position.py | 21 | ||||
-rw-r--r-- | pylint/test/functional/wrong_import_position.txt | 3 |
2 files changed, 24 insertions, 0 deletions
diff --git a/pylint/test/functional/wrong_import_position.py b/pylint/test/functional/wrong_import_position.py new file mode 100644 index 0000000..32a8314 --- /dev/null +++ b/pylint/test/functional/wrong_import_position.py @@ -0,0 +1,21 @@ +"""Checks import order rule""" +# pylint: disable=unused-import,relative-import,ungrouped-imports,wrong-import-order,using-constant-test + +import os.path +if True: + from astroid import are_exclusive +try: + import sys +except ImportError: + import datetime + +CONSTANT = True + +import datetime # [wrong-import-position] + +VAR = 0 +for i in range(10): + VAR += i + +import scipy # [wrong-import-position] +import astroid # [wrong-import-position] diff --git a/pylint/test/functional/wrong_import_position.txt b/pylint/test/functional/wrong_import_position.txt new file mode 100644 index 0000000..2f417e4 --- /dev/null +++ b/pylint/test/functional/wrong_import_position.txt @@ -0,0 +1,3 @@ +wrong-import-position:14::Import "import datetime" should be placed at the top of the module +wrong-import-position:20::Import "import scipy" should be placed at the top of the module +wrong-import-position:21::Import "import astroid" should be placed at the top of the module |