Skip to content

Commit

Permalink
tests: improvements to tests and code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Dec 28, 2020
1 parent c004aa9 commit 9c33204
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ dist
static
.*cache
profiling

# coverage stuff
.coverage
htmlcov
coverage.xml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ install:

test:
python -c 'import aw_server'
python -m pytest --cov aw_server tests/test_server.py
python -m pytest tests/test_server.py

typecheck:
python -m mypy aw_server --ignore-missing-imports
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ pytest-flask = "^0.15.0"
pytest-benchmark = "^3.2.2"
pytest-cov = "^2.10.1"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--cov-report=term --cov-report=xml --cov-report=html --cov=aw_server"
python_files = ["*.py",]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
6 changes: 6 additions & 0 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def bucket(flask_client):
assert r.status_code == 200


def test_info(flask_client):
r = flask_client.get("/api/0/info")
assert r.status_code == 200
assert r.json["testing"]


def test_buckets(flask_client, bucket, benchmark):
@benchmark
def list_buckets():
Expand Down

0 comments on commit 9c33204

Please sign in to comment.