From c707c7e3e248c2068aa731bcdbfb53b18492a407 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Thu, 25 Dec 2014 15:03:02 -0500 Subject: Add test for desired isort above commenting feature --- test_isort.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.2.1