Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit e81495e

Browse files
committed
Test Windows Python 3.x with GitHub Actions
Keep testing 2.7 with AppVeyor as GitHub Actions makes it hard to test Python 2.7 on Windows and Nox.
1 parent ee86d88 commit e81495e

File tree

4 files changed

+42
-16
lines changed

4 files changed

+42
-16
lines changed

.github/workflows/ci.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Continuous integration
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: windows-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version: [3.5, 3.6, 3.7, 3.8]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python.exe -m pip install --upgrade pip wheel nox
23+
- name: Test
24+
run: |
25+
python.exe -m nox -s test-${{ matrix.python-version }}
26+
- name: Coverage upload
27+
env:
28+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
29+
run: |
30+
python.exe -m pip install codecov
31+
python.exe -m codecov

appveyor.yml

-15
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,6 @@ environment:
1212
PYTHON_ARCH: "64"
1313
NOX_SESSION: "test-2.7"
1414

15-
- PYTHON: "C:\\Python35-x64"
16-
PYTHON_VERSION: "3.5.x"
17-
PYTHON_ARCH: "64"
18-
NOX_SESSION: "test-3.5"
19-
20-
- PYTHON: "C:\\Python36-x64"
21-
PYTHON_VERSION: "3.6.x"
22-
PYTHON_ARCH: "64"
23-
NOX_SESSION: "test-3.6"
24-
25-
- PYTHON: "C:\\Python37-x64"
26-
PYTHON_VERSION: "3.7.x"
27-
PYTHON_ARCH: "64"
28-
NOX_SESSION: "test-3.7"
29-
3015
cache:
3116
- C:\Users\appveyor\AppData\Local\pip\Cache
3217

test/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
# 3. To test our timeout logic by using two different values, eg. by using different
3737
# values at the pool level and at the request level.
3838
SHORT_TIMEOUT = 0.001
39-
LONG_TIMEOUT = 0.5 if os.environ.get("CI") else 0.01
39+
LONG_TIMEOUT = 0.5 if os.environ.get("CI") or os.environ.get("GITHUB_ACTIONS") else 0.01
4040

4141

4242
def clear_warnings(cls=HTTPWarning):

test/conftest.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
import platform
12
import sys
23

4+
import pytest
5+
36
# We support Python 3.6+ for async code
47
if sys.version_info[:2] < (3, 6):
58
collect_ignore_glob = ["async/*.py", "with_dummyserver/async/*.py"]
9+
10+
# The Python 3.8+ default loop on Windows breaks Tornado
11+
@pytest.fixture(scope="session", autouse=True)
12+
def configure_windows_event_loop():
13+
if sys.version_info >= (3, 8) and platform.system() == "Windows":
14+
import asyncio
15+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

0 commit comments

Comments
 (0)