Skip to content

Commit

Permalink
chore: ci use pytest to execute testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Oct 18, 2024
1 parent 341d702 commit 4eca23a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,19 @@ jobs:
- name: Django checks
run: ./manage.py check
- name: Test with Django
run: coverage run ./manage.py test
run: pytest --junitxml=junit.xml weblate_web
- name: Coverage
run: |
coverage combine
coverage xml
run: coverage xml
- uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
flags: unittests
name: Python ${{ matrix.python-version }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: DeepSource
continue-on-error: true
env:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
venv
/node_modules/
/invoices/
/.coverage
/junit.xml
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ target-version = ['py311']
[tool.isort]
profile = "black"

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "weblate_web.settings"
addopts = "--reuse-db --cov=weblate_web --cov-report="
python_files = ["test_*.py", "tests.py"]

[tool.ruff]
target-version = "py311"

Expand Down
3 changes: 3 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
coverage
pytest==8.3.3
pytest-cov==5.0.0
pytest-django==4.9.0
responses

0 comments on commit 4eca23a

Please sign in to comment.