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

Conversation

jdgsmallwood
Copy link
Contributor

Fixes #1805

The test suite failed on Windows 11 on a clean install due to the wrong number of log messages being captured by capsys.

Windows 11 was responding true to the

sys.__stdout__isatty() 

call in the pytest session, and due to the different logic gates around the "started" and "outcome" messages in briefcase/console.py lines 591-629, only the "outcome" message was logged.

This change aligns the logic between the "started" and "outcome" messages to ensure the suite passes on Windows 11.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@rmartin16
Copy link
Member

The logic differences between the "started" and "done" messages was intentional. We only want to show the "started" message when the Wait Bar is disabled. However, we want to show the "done" message more often; that includes when the Wait Bar is disabled but also any time a Wait Bar is not transient.

For this issue, I think we need to understand why isatty() is returning True in Pytest on Windows. The expectation is the tests run without a perceived TTY.

@jdgsmallwood
Copy link
Contributor Author

Thanks for the input Russell, I've got an alternative solution which utilizes os.isatty and this appears to behave on all platforms. I'm continuing to explore why there is a difference between

os.isatty(sys.__stdout__.fileno())  # returns correct expected result
sys.__stdout__.isatty()  # erroneous

on pytest on Windows 11.

Copy link
Member

@rmartin16 rmartin16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you!

I subscribed to pytest-dev/pytest#12349 so I should see any updates/insight provided by Pytest.

@rmartin16 rmartin16 merged commit 262f628 into beeware:main May 22, 2024
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test suite doesn't run on Windows 11
2 participants