Skip to content

Commit

Permalink
Use BlackRunner and .stdout in command line test
Browse files Browse the repository at this point in the history
So the next commit won't break this test. This is in its own commit so
we can just revert the depreciation commit when dropping Python 2
support completely.
  • Loading branch information
ichard26 committed Oct 21, 2021
1 parent c75abed commit 429ba44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,14 +1400,14 @@ def test_docstring_reformat_for_py27(self) -> None:
)
expected = 'def foo():\n """Testing\n Testing"""\n print "Foo"\n'

result = CliRunner().invoke(
result = BlackRunner().invoke(
black.main,
["-", "-q", "--target-version=py27"],
input=BytesIO(source),
)

self.assertEqual(result.exit_code, 0)
actual = result.output
actual = result.stdout
self.assertFormatEqual(actual, expected)

@staticmethod
Expand Down

0 comments on commit 429ba44

Please sign in to comment.