summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2014-12-25 15:03:02 -0500
committerTimothy Crosley <timothy.crosley@gmail.com>2014-12-25 15:03:02 -0500
commitc707c7e3e248c2068aa731bcdbfb53b18492a407 (patch)
treea4bec7875638fb6d3de7cf47ed29f0ef7aef6c80
parentdb9f7a2d1d6466f0fb8c12a2ec643dc0e0c6f725 (diff)
downloadisort-feature/fix-issue-163.tar.gz
Add test for desired isort above commenting featurefeature/fix-issue-163
-rw-r--r--test_isort.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test_isort.py b/test_isort.py
index 00a40303..9bfb6679 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -1105,3 +1105,11 @@ def test_placement_control():
"\n"
"import p24.imports._VERSION as VERSION\n"
"import p24.shared.media_wiki_syntax as syntax\n")
+
+def test_sticky_comments():
+ """Test to ensure it is possible to make comments 'stick' above imports"""
+ test_input = ("import os\n"
+ "\n"
+ "# Used for type-hinting (ref: https://github.com/davidhalter/jedi/issues/414). isort:comment-above\n"
+ "from selenium.webdriver.remote.webdriver import WebDriver # noqa\n")
+ assert SortImports(file_contents=test_input).output == test_input \ No newline at end of file