Skip to content

Commit

Permalink
Merge pull request #1823 from jdgsmallwood/fix-test-suite-on-windows-11
Browse files Browse the repository at this point in the history
Fix test suite on Windows 11
  • Loading branch information
rmartin16 authored May 22, 2024
2 parents a1d5168 + da0d877 commit 262f628
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changes/1823.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed failing tests on a Windows 11 development environment.
2 changes: 1 addition & 1 deletion src/briefcase/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def is_interactive(self):
should be specifically disabled in non-interactive sessions.
"""
# `sys.__stdout__` is used because Rich captures and redirects `sys.stdout`
return sys.__stdout__.isatty()
return os.isatty(sys.__stdout__.fileno())

@property
def is_color_enabled(self):
Expand Down
6 changes: 3 additions & 3 deletions tests/console/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys
import os
from unittest import mock

import pytest
Expand All @@ -11,7 +11,7 @@ def console(monkeypatch) -> Console:
console = Console()
console.input = mock.MagicMock(spec_set=input)
# default console is always interactive
monkeypatch.setattr(sys.__stdout__, "isatty", lambda: True)
monkeypatch.setattr(os, "isatty", lambda _: True)
return console


Expand All @@ -24,5 +24,5 @@ def disabled_console() -> Console:

@pytest.fixture
def non_interactive_console(console, monkeypatch) -> Console:
monkeypatch.setattr(sys.__stdout__, "isatty", lambda: False)
monkeypatch.setattr(os, "isatty", lambda _: False)
yield console

0 comments on commit 262f628

Please sign in to comment.