From 66ce99e4f016c4a42a5ee62f2c1f2a0aad5aa113 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 23 May 2019 10:30:32 +0100 Subject: [PATCH] Azure Pipelines - tests for windows (#538) * add azure-pipelines.yml * fix install command * skip some tests on windows --- azure-pipelines.yml | 33 +++++++++++++++++++++++++++++++++ tests/test_json.py | 2 ++ tests/test_types.py | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..5dea7fb --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,33 @@ +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +pool: + vmImage: 'windows-2019' + +strategy: + matrix: + Python36: + python.version: '3.6' + Python37: + python.version: '3.7' + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: 'Use Python $(python.version)' + +- script: | + pip install --user -U setuptools pip + pip install --user -U -r requirements.txt + pip install --user -e . + pip freeze + displayName: install + +- script: make test + displayName: test + +- script: make lint + displayName: lint + +- script: make mypy + displayName: mypy diff --git a/tests/test_json.py b/tests/test_json.py index e823eb6..7ee680d 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -1,5 +1,6 @@ import datetime import json +import sys from decimal import Decimal from enum import Enum from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network @@ -53,6 +54,7 @@ def test_encoding(input, output): assert output == json.dumps(input, default=pydantic_encoder) +@pytest.mark.skipif(sys.platform.startswith('win'), reason='paths look different on windows') def test_path_encoding(tmpdir): class PathModel(BaseModel): path: Path diff --git a/tests/test_types.py b/tests/test_types.py index 06115ce..e2c40e9 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -1,4 +1,5 @@ import os +import sys import uuid from collections import OrderedDict from datetime import date, datetime, time, timedelta @@ -1197,6 +1198,7 @@ def test_directory_path_validation_success(value, result): assert Model(foo=value).foo == result +@pytest.mark.skipif(sys.platform.startswith('win'), reason='paths look different on windows') @pytest.mark.parametrize( 'value,errors', (