Skip to content

Commit

Permalink
Add test case for issue #1670
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Feb 18, 2021
1 parent e4424e1 commit 25d1095
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/unit/test_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,3 +1537,34 @@ def test_isort_shouldnt_duplicate_comments_issue_1631():
import a # a comment; b comment
"""
)


def test_isort_shouldnt_add_extra_new_lines_with_import_heading_issue_1670():
snippet = """#!/usr/bin/python3 -ttu
# Standard Library
import argparse
import datetime
import attr
import requests
def foo() -> int:
print("Hello world")
return 0
def spam():
# Standard Library
import collections
import logging
"""
assert (
isort.code(
snippet,
import_heading_stdlib="Standard Library",
)
== snippet
)

0 comments on commit 25d1095

Please sign in to comment.