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

Commit

Permalink
Test Windows Python 3.x with GitHub Actions
Browse files Browse the repository at this point in the history
Keep testing 2.7 with AppVeyor as GitHub Actions makes it hard to test
Python 2.7 on Windows and Nox.
  • Loading branch information
pquentin committed Nov 26, 2019
1 parent ee86d88 commit 7a31c47
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 16 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Continuous integration

on: [push, pull_request]

jobs:
build:

runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python.exe -m pip install --upgrade pip wheel nox
- name: Test
run: |
python.exe -m nox -s test-${{ matrix.python-version }}
- name: Coverage upload
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
python.exe -m pip install codecov
python.exe -m codecov
15 changes: 0 additions & 15 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@ environment:
PYTHON_ARCH: "64"
NOX_SESSION: "test-2.7"

- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.x"
PYTHON_ARCH: "64"
NOX_SESSION: "test-3.5"

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"
NOX_SESSION: "test-3.6"

- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "64"
NOX_SESSION: "test-3.7"

cache:
- C:\Users\appveyor\AppData\Local\pip\Cache

Expand Down
2 changes: 1 addition & 1 deletion test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# 3. To test our timeout logic by using two different values, eg. by using different
# values at the pool level and at the request level.
SHORT_TIMEOUT = 0.001
LONG_TIMEOUT = 0.5 if os.environ.get("CI") else 0.01
LONG_TIMEOUT = 0.5 if os.environ.get("CI") or os.environ.get("GITHUB_ACTIONS") else 0.01


def clear_warnings(cls=HTTPWarning):
Expand Down
11 changes: 11 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import platform
import sys

import pytest

# We support Python 3.6+ for async code
if sys.version_info[:2] < (3, 6):
collect_ignore_glob = ["async/*.py", "with_dummyserver/async/*.py"]

# The Python 3.8+ default loop on Windows breaks Tornado
@pytest.fixture(scope="session", autouse=True)
def configure_windows_event_loop():
if sys.version_info >= (3, 8) and platform.system() == "Windows":
import asyncio

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

0 comments on commit 7a31c47

Please sign in to comment.