pytest icon indicating copy to clipboard operation
pytest copied to clipboard

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

Open jdgsmallwood opened this issue 1 year ago • 0 comments

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
  • [x] a detailed description of the bug or problem you are having
  • [x] output of pip list from the virtual environment you are using
  • [x] pytest and operating system versions
  • [x] minimal example if possible

jdgsmallwood avatar May 21 '24 19:05 jdgsmallwood