Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- Fix missing modules in self-contained binaries (#2466)
- Fix missing toml extra used during installation (#2475)

### Tests

- Fix patching of `io.TextIOWrapper` (#2489)

## 21.8b0

### _Black_
Expand Down
6 changes: 4 additions & 2 deletions tests/test_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)
import pytest
import unittest
from unittest.mock import patch, MagicMock
from unittest.mock import patch, MagicMock, Mock
from parameterized import parameterized

import click
Expand Down Expand Up @@ -1689,7 +1689,9 @@ def test_reformat_one_with_stdin_and_existing_path(self) -> None:

def test_reformat_one_with_stdin_empty(self) -> None:
output = io.StringIO()
with patch("io.TextIOWrapper", lambda *args, **kwargs: output):
mock_io = Mock()
mock_io.TextIOWrapper.return_value = output
with patch.object(black, "io", mock_io):
try:
black.format_stdin_to_stdout(
fast=True,
Expand Down