Skip to content

sys.__stdout__.isatty() returns incorrect value for Windows 11 #12349

Open
@jdgsmallwood

Description

@jdgsmallwood

Pytest is returning an incorrect value for sys.__stdout__.isatty() on Windows 11 vs Linux / previous versions of Windows.

To reproduce:

  1. Create a file with the following code
import sys
import os 
def test_example():    
    assert not sys.__stdout__.isatty()
    assert not os.isatty(sys.__stdout__.fileno())
  1. Run pytest from the terminal - tests will pass on Linux / Windows pre-11 and fail on Windows 11.

Output of pip list

Package    Version
---------- -------
colorama   0.4.6
iniconfig  2.0.0
packaging  24.0
pip        22.3.1
pluggy     1.5.0
pytest     8.2.1
setuptools 65.5.0
  • a detailed description of the bug or problem you are having
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions
  • minimal example if possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: windowswindows platform-specific problemplugin: capturerelated to the capture builtin plugintype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions