Skip to content

Commit

Permalink
improve testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-mixas committed Jan 28, 2024
1 parent f27220a commit a26a37c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 30 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,47 @@ jobs:
matrix:
os: ['ubuntu-20.04']
python-version:
- 3.7
- 3.8
- 3.9
- pypy-3.7
- pypy-3.8
- pypy-3.9
- pypy-3.10
- '3.7'
- '3.8'
- '3.9'
- 'pypy-3.7'
- 'pypy-3.8'
- 'pypy-3.9'
- 'pypy-3.10'
tox-env: ['essential']
include:
- os: macos-latest
python-version: '3.12'
tox-env: essential
- os: windows-latest
python-version: '3.12'
python-version: '3.11'
tox-env: essential
- os: ubuntu-latest
python-version: '3.10'
tox-env: linters
- os: ubuntu-latest
python-version: '3.11'
tox-env: coverage
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.architecture }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
pip install --quiet --upgrade pip setuptools tox>=4.5.1
- name: Run test without coverage
if: ${{ matrix.tox-env != 'coverage' }}
- name: Run essential tests
if: ${{ matrix.tox-env != 'linters' }}
run: |
tox run -e ${{ matrix.tox-env }}
- name: Run tests with coverage
if: ${{ matrix.tox-env == 'coverage' }}
- name: Run linters and coverage
if: ${{ matrix.tox-env == 'linters' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install --quiet --upgrade coveralls
tox run -e coverage
tox run -e linters
coveralls --service=github
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ lint = [
]
test = [
'pytest',
'pytest-cov',
]

[project.scripts]
Expand All @@ -78,6 +79,12 @@ Homepage = 'https://github.com/mr-mixas/Nested-Diff.py'
Repository = 'https://github.com/mr-mixas/Nested-Diff.py.git'

[tool.pytest.ini_options]
addopts = '-vv'
addopts = """
--cov=nested_diff \
--cov-fail-under=99 \
--cov-report term-missing \
--no-cov-on-fail \
--verbosity=2 \
"""
doctest_optionflags = 'NORMALIZE_WHITESPACE'
testpaths = 'nested_diff tests'
13 changes: 0 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ extras =
setenv =
PYTHONHASHSEED = 1

[testenv:coverage]
commands =
coverage run --source nested_diff -m pytest

deps =
coverage

extras =
{[testenv:essential]extras}

setenv =
PYTHONHASHSEED = 1

[testenv:linters]
commands =
pytest --doctest-modules --flake8
Expand Down

0 comments on commit a26a37c

Please sign in to comment.