1
0
Fork 0

Check Python unittest coverage

This commit is contained in:
Joris van Rantwijk 2023-04-14 11:23:32 +02:00
parent a3f29f0988
commit 536529c36c
1 changed files with 24 additions and 1 deletions

View File

@ -29,18 +29,41 @@ jobs:
- name: Run pylint - name: Run pylint
run: pylint --ignore=test_mwmatching.py python tests run: pylint --ignore=test_mwmatching.py python tests
# Run tests on Python code.
full-test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: pip install --upgrade coverage
- name: Show Python version
run: python3 --version
- name: Run unittests
run: python3 python/test_mwmatching.py
- name: Check unittest coverage
run: |
coverage erase
coverage run --branch python/test_mwmatching.py
coverage report -m --fail-under=99
# Run unittests on multiple Python versions. # Run unittests on multiple Python versions.
unittest-python: unittest-python:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"] python-version: ["3.7", "3.8", "3.9", "3.10", "3.12-dev", "pypy3.9"]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Show Python version
run: python3 --version
- name: Run unittests - name: Run unittests
run: python3 python/test_mwmatching.py run: python3 python/test_mwmatching.py