Skip to content

Commit

Permalink
Merge pull request #11 from fly-apps/katia/add-pytest-cov
Browse files Browse the repository at this point in the history
Add pytest-cov for coverage reports
  • Loading branch information
katiayn authored Jun 14, 2024
2 parents e04ceef + b801f41 commit 65fed25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
__pycache__/
.pytest_cache/

# Test coverage
.coverage

# Dependency directories
poetry.lock

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ cd dockerfile-django/
poetry run pytest
```

To produce a coverage report, run:

```shell
poetry run pytest --cov=dockerfile_django
```

#### Activating the virtual environment and running the tests

1. Navigate to the project directory (root)
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ readme = "README.md"
dockerfile-django = "dockerfile_django.main:cli"

[tool.poetry.dependencies]
python = "^3.7"
python = ">=3.8"
typer = "^0.12.3"
jinja2 = "^3.1.3"
markupsafe = "^2.1.5"
Expand All @@ -19,14 +19,15 @@ toml = "^0.10.2"
[tool.poetry.group.dev.dependencies]
pytest = "7.4.4"
ruff = "^0.4.8"
pytest-cov = "^5.0.0"

[tool.ruff]
line-length = 79
indent-width = 4

[tool.ruff.lint]
preview = true
select = ['F', 'I', 'E', 'W', 'PT', 'PL']
select = ["F", "I", "E", "W", "PT", "PL"]

[tool.ruff.format]
preview = true
Expand Down

0 comments on commit 65fed25

Please sign in to comment.