Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test suite on Windows 11 #1823

Merged
merged 6 commits into from
May 22, 2024
Merged
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
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