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 authored and JelleZijlstra committed Oct 31, 2021
1 parent 7bf233a commit f13227b
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 @@ -10,6 +10,7 @@
- Bumped typed-ast version minimum to 1.4.3 for 3.10 compatiblity (#2519)
- Fixed a Python 3.10 compatibility issue where the loop argument was still being passed
even though it has been removed (#2580)
- 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 @@ -1401,14 +1401,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 f13227b

Please sign in to comment.