Skip to content

Commit

Permalink
run tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
onerandomusername committed Sep 25, 2024
1 parent 2853cb4 commit 61d6e76
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
# coverage report to github.
- name: Run tests and generate coverage report
id: run_tests
run: poetry run pytest tests -n auto --dist loadfile --cov --disable-warnings -q
run: python -m poetry run pytest tests -n auto --dist loadfile --cov --disable-warnings -q

# This step will publish the coverage reports to coveralls.io and
# print a "job" link in the output of the GitHub Action
Expand All @@ -183,7 +183,7 @@ jobs:
COVERALLS_FLAG_NAME: coverage-${{ runner.os }}-python-${{ env.PYTHON_VERSION }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github
run: poetry run coveralls
run: python -m poetry run coveralls

coveralls-finish:
name: Indicate completion to coveralls.io
Expand Down
9 changes: 9 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import asyncio
import os


# On windows aiodns's asyncio support relies on APIs like add_reader (which aiodns uses)
# are not guaranteed to be available, and in particular are not available when using the
# ProactorEventLoop on Windows, this method is only supported with Windows SelectorEventLoop
if os.name == "nt":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

0 comments on commit 61d6e76

Please sign in to comment.