From 4acbb6da9480ed35a22cd097949eb01c8c13fd4a Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Tue, 2 Mar 2021 23:03:50 -0800 Subject: [PATCH] Create failing test for issue #1667 --- tests/unit/test_regressions.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/unit/test_regressions.py b/tests/unit/test_regressions.py index 749bf6307..a823d398e 100644 --- a/tests/unit/test_regressions.py +++ b/tests/unit/test_regressions.py @@ -1568,3 +1568,20 @@ def spam(): ) == snippet ) + + +def test_isort_shouldnt_add_extra_line_float_to_top_issue_1667(): + assert isort.check_code( + """ + import sys + +sys.path.insert(1, 'path/containing/something_else/..') + +import something_else # isort:skip + +# Some constant +SOME_CONSTANT = 4 +""", + show_diff=True, + float_to_top=True, + )