Skip to content

Commit

Permalink
We're expected to support inline comments in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
acatton committed Apr 7, 2016
1 parent 8b98d8b commit 31872e5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_formatters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
import ast
from textwrap import dedent

Expand Down Expand Up @@ -71,3 +72,18 @@ def test_hacking_support_python2():
""")

assert format_(code, formatter=hacking) == code


@pytest.mark.xfail(reason="Comments are not parsed yet")
def test_hacking_preserve_inline_comments():
bad_code = dedent("""\
import thirdparty # Third party library
import os""")

expected = dedent("""\
import os
import thirdparty # Third party library""")

assert format_(bad_code, formatter=hacking) == expected

0 comments on commit 31872e5

Please sign in to comment.