Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cobertura de Testes - Parte 01 #81

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/pytest.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Install Dependencies
run: |
pip install poetry
poetry install --no-root

- name: Run tests with coverage
run: poetry run pytest --cov=src --cov-report=xml --cov-fail-under=80

- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: coverage.xml
2,325 changes: 1,199 additions & 1,126 deletions poetry.lock

Large diffs are not rendered by default.

21 changes: 8 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,18 @@ watchfiles = "^0.23.0"
websockets = "^13.0"
zipp = "^3.20.0"
mkdocs-material = "^9.5.33"
mkdocstrings = "^0.25.2"
mkdocstrings-python = "^1.10.8"
mkdocs-glightbox = "^0.4.0"
pytest-mock = "^3.14.0"
pytest = "^8.3.2"
pytest-coverage = "^0.0"
mangum = "^0.19.0"
pytest-cov = "^6.0.0"
pytest = "^8.3.4"
mkdocstrings = "^0.27.0"
mkdocstrings-python = "^1.13.0"

[tool.poetry.group.doc.dependencies]
mkdocs-material = "^9.5.33"
mkdocstrings = "^0.25.2"
mkdocstrings-python = "^1.10.8"
mkdocs-glightbox = "^0.4.0"

[tool.poetry.group.test.dependencies]
pytest = "^8.3.2"
pytest-coverage = "^0.0"

[tool.poetry.group.dev.dependencies]
python-dotenv = "^1.0.1"
python-jose = "^3.3.0"
Expand All @@ -102,8 +96,8 @@ badge-format = "svg"
exclude = ["setup.py", "docs", "build", "app/tests"]

[tool.pytest.ini_options]
pythonpath = "."
addopts = '-p no:warnings'
addopts = "--cov=app --cov-report html --cov-fail-under=80"
testpaths = ["tests"]

[tool.ruff]
line-length = 120
Expand All @@ -114,8 +108,9 @@ preview = true
quote-style = 'single'

[tool.taskipy.tasks]
run = 'fastapi dev fastapi_template/app.py'
test = 'docker compose run tests'
test-coverage = 'poetry run pytest --cov=src --cov-fail-under=80'
test-report = 'poetry run pytest --cov=src --cov-report=html'
lint = 'ruff check . && ruff check . --diff'
format = 'ruff check . --fix && ruff format .'
pre-commit = 'pre-commit run --all-files'
Expand Down
File renamed without changes.
Empty file added tests/test-auth.py
Empty file.
File renamed without changes.
File renamed without changes.
Loading