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

Improve tests on windows #2799

Merged
merged 7 commits into from
Jan 19, 2020
Merged

Improve tests on windows #2799

merged 7 commits into from
Jan 19, 2020

Conversation

bdarnell
Copy link
Member

Fix various issues with tests on windows (and when running tests outside of runtests.py):

  • Add gitattributes file to control line endings
  • Force the use of the selector event loop in tests (this may be replaced by a more general solution in the future, but for now this gets the tests working)
  • Skip a few tests and add some attribute guards
  • Add a level argument to ExpectLog so it doesn't rely on logging configuration from runtests.py

This ensures that the tests pass on Windows regardless of the user's git
CRLF settings.
@ploxiln
Copy link
Contributor

ploxiln commented Jan 19, 2020

it looks like WindowsSelectorEventLoopPolicy was added in python-3.7 ... but the DefaultEventLoopPolicy works before then, so if you only try to set it if it exists, that would do the trick

This gets most of the tests working again on windows with py38.
Alternate resolvers behave differently on this platform for unknown
reasons.
This name is not present on all platforms
This makes it possible for tests to be a little more precise, and also
makes them less dependent on exactly how the test is run (runtests.py
sets the logging level to info, but when running tests directly from
an editor it may use the default of warnings-only).

CI only runs the tests with runtests.py, so this might regress, but I'm
not building anything to prevent that yet (options include running the
tests differently in CI or making ExpectLog always use a fixed log
configuration instead of picking up the current one)
@bdarnell bdarnell merged commit 18b653c into master Jan 19, 2020
@bdarnell bdarnell deleted the wintest branch January 19, 2020 22:58
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.

2 participants