Skip to content

Commit ad5d60c

Browse files
chore: add running unit tests on windows/macos
Add running the unit tests on windows-latest and macos-latest with Python 3.10.
1 parent 3a7d6f6 commit ad5d60c

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

.github/workflows/test.yml

+21-13
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,39 @@ env:
1414

1515
jobs:
1616
unit:
17-
runs-on: ubuntu-20.04
17+
runs-on: ${{ matrix.os }}
1818
strategy:
1919
matrix:
20-
include:
21-
- python-version: 3.7
20+
os: [ubuntu-latest]
21+
python:
22+
- version: "3.7"
2223
toxenv: py37
23-
- python-version: 3.8
24+
- version: "3.8"
2425
toxenv: py38
25-
- python-version: 3.9
26+
- version: "3.9"
2627
toxenv: py39
27-
- python-version: "3.10"
28-
toxenv: py310
29-
- python-version: "3.10"
30-
toxenv: smoke
28+
- version: "3.10"
29+
toxenv: py310,smoke
30+
include:
31+
- os: macos-latest
32+
python:
33+
version: "3.10"
34+
toxenv: py310,smoke
35+
- os: windows-latest
36+
python:
37+
version: "3.10"
38+
toxenv: py310,smoke
3139
steps:
3240
- uses: actions/checkout@v2
33-
- name: Set up Python ${{ matrix.python-version }}
41+
- name: Set up Python ${{ matrix.python.version }}
3442
uses: actions/setup-python@v2
3543
with:
36-
python-version: ${{ matrix.python-version }}
44+
python-version: ${{ matrix.python.version }}
3745
- name: Install dependencies
38-
run: pip install tox pytest-github-actions-annotate-failures
46+
run: pip3 install tox pytest-github-actions-annotate-failures
3947
- name: Run tests
4048
env:
41-
TOXENV: ${{ matrix.toxenv }}
49+
TOXENV: ${{ matrix.python.toxenv }}
4250
run: tox
4351

4452
functional:

tests/unit/test_config.py

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import io
1919
import os
20+
import sys
2021
from textwrap import dedent
2122
from unittest import mock
2223

@@ -214,6 +215,7 @@ def test_valid_data(m_open, path_exists):
214215

215216
@mock.patch("os.path.exists")
216217
@mock.patch("builtins.open")
218+
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not supported on Windows")
217219
def test_data_from_helper(m_open, path_exists, tmp_path):
218220
helper = tmp_path / "helper.sh"
219221
helper.write_text(

0 commit comments

Comments
 (0)