Skip to content

Commit

Permalink
Make windows job names explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Jan 27, 2020
1 parent e18fec9 commit b92b1c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: required

matrix:
include:
- name: "Windows, Python Latest"
- name: "Windows, Python Latest: multiprocessing"
os: windows
language: sh
python: 3.x # only works on linux
Expand All @@ -13,7 +13,7 @@ matrix:
- export PATH="/c/Python:/c/Python/Scripts:$PATH"
- python -m pip install --upgrade pip wheel

- name: "Windows, Python 3.7"
- name: "Windows, Python 3.7: multiprocessing"
os: windows
python: 3.7 # only works on linux
language: sh
Expand All @@ -24,17 +24,17 @@ matrix:

- name: "Python 3.7: multiprocessing"
python: 3.7 # this works for Linux but is ignored on macOS or Windows
env: SPAWN_BACKEND=mp
env: SPAWN_BACKEND="mp"
- name: "Python 3.7: trio-run-in-process"
python: 3.7 # this works for Linux but is ignored on macOS or Windows
env: SPAWN_BACKEND=trio_run_in_process
env: SPAWN_BACKEND="trio_run_in_process"

- name: "Pytron 3.8: multiprocessing"
python: 3.8 # this works for Linux but is ignored on macOS or Windows
env: SPAWN_BACKEND=mp
env: SPAWN_BACKEND="mp"
- name: "Python 3.8: trio-run-in-process"
python: 3.8 # this works for Linux but is ignored on macOS or Windows
env: SPAWN_BACKEND=trio_run_in_process
env: SPAWN_BACKEND="trio_run_in_process"

install:
- cd $TRAVIS_BUILD_DIR
Expand All @@ -43,4 +43,4 @@ install:

script:
- mypy tractor/ --ignore-missing-imports
- pytest tests/ --no-print-logs --spawn-backend=$SPAWN_BACKEND
- pytest tests/ --no-print-logs --spawn-backend=${SPAWN_BACKEND}
15 changes: 8 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import pytest
import tractor
from tractor.testing import tractor_test


pytest_plugins = ['pytester']
Expand All @@ -16,7 +15,7 @@
def pytest_addoption(parser):
parser.addoption(
"--ll", action="store", dest='loglevel',
default=None, help="logging level to set when testing"
default=None, help="logging level to set when testing"
)

parser.addoption(
Expand All @@ -29,7 +28,7 @@ def pytest_addoption(parser):
def pytest_configure(config):
backend = config.option.spawn_backend

if plaform.system() == "Windows":
if platform.system() == "Windows":
backend = 'mp'

if backend == 'mp':
Expand Down Expand Up @@ -59,13 +58,15 @@ def pytest_generate_tests(metafunc):
if spawn_backend == 'mp':
from multiprocessing import get_all_start_methods
methods = get_all_start_methods()
if 'fork' in methods: # fork not available on windows, so check before removing
# XXX: the fork method is in general incompatible with
# trio's global scheduler state
if 'fork' in methods:
# fork not available on windows, so check before
# removing XXX: the fork method is in general
# incompatible with trio's global scheduler state
methods.remove('fork')
elif spawn_backend == 'trio_run_in_process':
if platform.system() == "Windows":
pytest.fail("Only `--spawn-backend=mp` is supported on Windows")
pytest.fail(
"Only `--spawn-backend=mp` is supported on Windows")

methods = ['trio_run_in_process']

Expand Down

0 comments on commit b92b1c3

Please sign in to comment.