Skip to content

Commit 9c33204

Browse files
committed
tests: improvements to tests and code coverage
1 parent c004aa9 commit 9c33204

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ dist
77
static
88
.*cache
99
profiling
10+
11+
# coverage stuff
1012
.coverage
13+
htmlcov
14+
coverage.xml

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install:
1919

2020
test:
2121
python -c 'import aw_server'
22-
python -m pytest --cov aw_server tests/test_server.py
22+
python -m pytest tests/test_server.py
2323

2424
typecheck:
2525
python -m mypy aw_server --ignore-missing-imports

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ pytest-flask = "^0.15.0"
2424
pytest-benchmark = "^3.2.2"
2525
pytest-cov = "^2.10.1"
2626

27+
[tool.pytest.ini_options]
28+
minversion = "6.0"
29+
addopts = "--cov-report=term --cov-report=xml --cov-report=html --cov=aw_server"
30+
python_files = ["*.py",]
31+
2732
[build-system]
2833
requires = ["poetry>=0.12"]
2934
build-backend = "poetry.masonry.api"

tests/test_server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ def bucket(flask_client):
2020
assert r.status_code == 200
2121

2222

23+
def test_info(flask_client):
24+
r = flask_client.get("/api/0/info")
25+
assert r.status_code == 200
26+
assert r.json["testing"]
27+
28+
2329
def test_buckets(flask_client, bucket, benchmark):
2430
@benchmark
2531
def list_buckets():

0 commit comments

Comments
 (0)