Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 19, 2021
1 parent 6eadac4 commit 810f982
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/unit/test_base_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,17 @@ def test_write_without_stdout_buffer():
line = "Something to write"
source = "source"

buffer_side_effect = AttributeError("'_io.StringIO' object has no \
attribute 'buffer'")
buffer_side_effect = AttributeError(
"'_io.StringIO' object has no \
attribute 'buffer'"
)
buffer_write_mock = mock.Mock(side_effect=buffer_side_effect)

write_mock = mock.Mock()
mock.patch("flake8.formatting.base.sys.stdout.write", write_mock)

with mock.patch(
"flake8.formatting.base.sys.stdout.buffer.write",
buffer_write_mock
"flake8.formatting.base.sys.stdout.buffer.write", buffer_write_mock
):
formatter = base.BaseFormatter(options())
formatter.write(line, source)
Expand Down

0 comments on commit 810f982

Please sign in to comment.