From 646742900fca6d717aee12b9784f157b1363b4be Mon Sep 17 00:00:00 2001 From: wim glenn Date: Sun, 27 Aug 2023 20:48:12 -0500 Subject: [PATCH] test 2.7 in container --- .github/workflows/tests.yml | 42 +++++++++++++++++++++++++++++-------- tests/test_plugin.py | 2 +- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e953f0..5185422 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,9 +2,9 @@ name: tests on: push: - branches: ["master"] + branches: ["main"] pull_request: - branches: ["master"] + branches: ["main"] workflow_dispatch: jobs: @@ -14,16 +14,40 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["2.7", "3.10"] - pytest-version: ["< 7", ""] + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" steps: - - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v2" + - uses: "actions/checkout@v3" + + - uses: "actions/setup-python@v4" with: python-version: "${{ matrix.python-version }}" - - name: "Install ${{ matrix.pytest-version }}" - run: "python -m pip install 'pytest${{ matrix.pytest-version }}'" + + - name: "Install pytest" + run: pip install pytest + - name: "Run tests for ${{ matrix.python-version }} on ${{ matrix.os }}" run: python -m pytest + + tests-27: + name: "Python 2.7 on ubuntu-20.04" + runs-on: ubuntu-20.04 + container: + image: python:2.7-buster + + steps: + - uses: "actions/checkout@v3" + - name: "Install pytest" + run: pip install pytest + + - name: "Run tests for Python 2.7 on ubuntu-20.04" + run: python -m pytest diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 40484c0..eba8dee 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -100,5 +100,5 @@ def test_name_error_instance(): if sys.version_info < (3,): txt = "E * AssertionError: Pattern '2101' not found in 'somebody set up us the bomb'" else: - txt = "E * AssertionError: Regex pattern '2101' does not match 'somebody set up us the bomb'." + txt = "E * AssertionError: Regex pattern did not match." result.stdout.fnmatch_lines([txt])