Skip to content

Commit 78aedae

Browse files
Fix broken monkeypatch references
1 parent d7241a4 commit 78aedae

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

tests/usethis/test_console.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def test_cached_exception(self, capfd: pytest.CaptureFixture[str]) -> None:
197197
class TestGetIconMode:
198198
def test_unicode_support(self, monkeypatch: pytest.MonkeyPatch) -> None:
199199
# Arrange
200-
monkeypatch.setattr("usethis._console._get_encoding", lambda: "utf-8")
200+
monkeypatch.setattr("usethis._console._get_stdout_encoding", lambda: "utf-8")
201201
get_icon_mode.cache_clear()
202202

203203
# Act
@@ -208,7 +208,7 @@ def test_unicode_support(self, monkeypatch: pytest.MonkeyPatch) -> None:
208208

209209
def test_universal_support(self, monkeypatch: pytest.MonkeyPatch) -> None:
210210
# Arrange - use cp437 which supports universal but not unicode icons
211-
monkeypatch.setattr("usethis._console._get_encoding", lambda: "cp437")
211+
monkeypatch.setattr("usethis._console._get_stdout_encoding", lambda: "cp437")
212212
get_icon_mode.cache_clear()
213213

214214
# Act
@@ -219,7 +219,7 @@ def test_universal_support(self, monkeypatch: pytest.MonkeyPatch) -> None:
219219

220220
def test_text_fallback(self, monkeypatch: pytest.MonkeyPatch) -> None:
221221
# Arrange
222-
monkeypatch.setattr("usethis._console._get_encoding", lambda: "ascii")
222+
monkeypatch.setattr("usethis._console._get_stdout_encoding", lambda: "ascii")
223223
get_icon_mode.cache_clear()
224224

225225
# Act
@@ -249,7 +249,7 @@ def test_unicode_mode_returns_unicode_icons(
249249
self, monkeypatch: pytest.MonkeyPatch
250250
) -> None:
251251
# Arrange
252-
monkeypatch.setattr("usethis._console._get_encoding", lambda: "utf-8")
252+
monkeypatch.setattr("usethis._console._get_stdout_encoding", lambda: "utf-8")
253253
get_icon_mode.cache_clear()
254254

255255
# Act & Assert
@@ -264,7 +264,7 @@ def test_universal_mode_returns_universal_icons(
264264
self, monkeypatch: pytest.MonkeyPatch
265265
) -> None:
266266
# Arrange
267-
monkeypatch.setattr("usethis._console._get_encoding", lambda: "cp437")
267+
monkeypatch.setattr("usethis._console._get_stdout_encoding", lambda: "cp437")
268268
get_icon_mode.cache_clear()
269269

270270
# Act & Assert
@@ -279,7 +279,7 @@ def test_text_mode_returns_text_labels(
279279
self, monkeypatch: pytest.MonkeyPatch
280280
) -> None:
281281
# Arrange
282-
monkeypatch.setattr("usethis._console._get_encoding", lambda: "ascii")
282+
monkeypatch.setattr("usethis._console._get_stdout_encoding", lambda: "ascii")
283283
get_icon_mode.cache_clear()
284284

285285
# Act & Assert
@@ -299,7 +299,7 @@ def test_tick_print_with_text_mode(
299299
self, capfd: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch
300300
) -> None:
301301
# Arrange
302-
monkeypatch.setattr("usethis._console._get_encoding", lambda: "ascii")
302+
monkeypatch.setattr("usethis._console._get_stdout_encoding", lambda: "ascii")
303303
get_icon_mode.cache_clear()
304304

305305
# Act
@@ -313,7 +313,7 @@ def test_warn_print_with_universal_mode(
313313
self, capfd: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch
314314
) -> None:
315315
# Arrange
316-
monkeypatch.setattr("usethis._console._get_encoding", lambda: "cp437")
316+
monkeypatch.setattr("usethis._console._get_stdout_encoding", lambda: "cp437")
317317
get_icon_mode.cache_clear()
318318

319319
# Act

0 commit comments

Comments
 (0)