Skip to content

Commit

Permalink
Prepare for Python 2 depreciation
Browse files Browse the repository at this point in the history
- Use BlackRunner and .stdout in command line test

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 79acf4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Add new `--workers` parameter (#2514)
- Fixed feature detection for positional-only arguments in lambdas (#2532)
- Bumped typed-ast version minimum to 1.4.3 for 3.10 compatiblity (#2519)
- Deprecate Python 2 formatting support (#2523)

### _Blackd_

Expand Down
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 79acf4e

Please sign in to comment.