Skip to content

Commit

Permalink
Reorganize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Oct 7, 2024
1 parent afc39f8 commit b0bef37
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions tests/test_blacken_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,12 @@ def test_format_src_rst():
)


def test_format_src_rst_empty():
before = "some text\n\n.. code-block:: python\n\n\nsome other text\n"
after, _ = blacken_docs.format_str(before, BLACK_MODE)
assert after == before


def test_format_src_rst_literal_blocks():
before = dedent(
"""\
Expand All @@ -560,6 +566,21 @@ def test_format_src_rst_literal_blocks():
)


def test_format_src_rst_literal_block_empty():
before = dedent(
"""\
hello::
world
"""
)
after, _ = blacken_docs.format_str(
before,
BLACK_MODE,
rst_literal_blocks=True,
)
assert after == before


def test_format_src_rst_literal_blocks_nested():
before = dedent(
"""
Expand Down Expand Up @@ -1325,13 +1346,7 @@ def test_format_src_rst_pycon_comments():
assert after == before


def test_format_empty_python_code_block():
before = "some text\n\n.. code-block:: python\n\n\nsome other text\n"
after, _ = blacken_docs.format_str(before, BLACK_MODE)
assert after == before


def test_format_empty_pycon_code_block():
def test_format_src_rst_pycon_empty():
before = "some text\n\n.. code-block:: pycon\n\n\nsome other text\n"
after, _ = blacken_docs.format_str(before, BLACK_MODE)
assert after == before

0 comments on commit b0bef37

Please sign in to comment.