Kaydet (Commit) 5a6c157f authored tarafından Anthony Sottile's avatar Anthony Sottile

tiny cleanup

üst 00d404e4
......@@ -916,20 +916,16 @@ def test_main_py36_plus_function_trailing_commas(
def test_main_stdin_no_changes(capsys):
with mock.patch.object(
sys, 'stdin',
io.TextIOWrapper(io.BytesIO(b'x = 5\n'), 'UTF-8'),
):
stdin = io.TextIOWrapper(io.BytesIO(b'x = 5\n'), 'UTF-8')
with mock.patch.object(sys, 'stdin', stdin):
assert main(('-',)) == 0
out, err = capsys.readouterr()
assert out == 'x = 5\n'
def test_main_stdin_with_changes(capsys):
with mock.patch.object(
sys, 'stdin',
io.TextIOWrapper(io.BytesIO(b'x(\n 1\n)\n'), 'UTF-8'),
):
stdin = io.TextIOWrapper(io.BytesIO(b'x(\n 1\n)\n'), 'UTF-8')
with mock.patch.object(sys, 'stdin', stdin):
assert main(('-',)) == 1
out, err = capsys.readouterr()
assert out == 'x(\n 1,\n)\n'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment