diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 32c6702..daa0401 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ jobs: name: Python ${{ matrix.python-version }} runs-on: ubuntu-latest env: - USING_COVERAGE: '3.8' + USING_COVERAGE: '3.10' strategy: fail-fast: true matrix: @@ -28,13 +28,23 @@ jobs: python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions - - name: "Run tox targets for ${{ matrix.python-version }}" - run: "python -m tox" - - name: "Combine coverage" - if: "contains(env.USING_COVERAGE, matrix.python-version)" + python -m pip install -r requirements.txt + python -m pip install -r requirements-test.txt + - name: "Run tests for ${{ matrix.python-version }}" run: | set -xe + pip install pytest-cov + pip install coverage + pytest \ + -qq \ + --timeout=9 \ + --durations=10 \ + -n auto \ + --cov georss_ingv_centro_nazionale_terremoti_client \ + --cov-report xml \ + -o console_output_style=count \ + -p no:sugar \ + tests python -m coverage xml - name: "Upload coverage to Codecov" if: "contains(env.USING_COVERAGE, matrix.python-version)" diff --git a/pyproject.toml b/pyproject.toml index d4c1601..8e06a23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,3 +43,8 @@ ignore = [ # Ignored due to performance: https://github.com/charliermarsh/ruff/issues/2923 "UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` ] + +[tool.pytest.ini_options] +testpaths = [ + "tests", +] diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 0000000..722519e --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,4 @@ +pytest +pytest-timeout +pytest-xdist +pytest-cov diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..77f675d --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +georss_client>=0.15 diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 28cb038..0000000 --- a/tox.ini +++ /dev/null @@ -1,36 +0,0 @@ -[tox] -envlist = py38, py39, py310, cov, cov_local -skip_missing_interpreters = True -ignore_basepython_conflict = True - -[gh-actions] -python = - 3.8: cov - 3.9: py39 - 3.10: py310 - -[testenv] -deps= - pytest - mock -commands=pytest - -[testenv:cov] -basepython=python3.8 -deps= - pytest - pytest-cov - mock -commands= - pytest --cov --cov-report= {posargs} - -[testenv:cov_local] -basepython=python3.8 -deps= - pytest - pytest-cov - mock -commands= - pytest --cov --cov-report= - coverage report - coverage html