Skip to content

Commit

Permalink
Migrate to pytest (#26)
Browse files Browse the repository at this point in the history
* add requirements

* use pytest

* remove unnecessary file

* use pytest
  • Loading branch information
exxamalte committed Jan 31, 2024
1 parent 6b50096 commit c0a567d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 42 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)"
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
4 changes: 4 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pytest
pytest-timeout
pytest-xdist
pytest-cov
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
georss_client>=0.15
36 changes: 0 additions & 36 deletions tox.ini

This file was deleted.

0 comments on commit c0a567d

Please sign in to comment.