Skip to content

Commit 2080bf8

Browse files
authored
Update dependencies, coverage with pytest-cov (#239)
* remove flask * sort dependencies * add coveralls badge * add coveralls * update make test to create coverage reports * split script commands, add coveralls upload step * remove unneeded modules and imports * regenerate lockfile
1 parent 06ae920 commit 2080bf8

File tree

8 files changed

+111
-120
lines changed

8 files changed

+111
-120
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ install:
77
- "pip install pipenv"
88
- "pipenv install --dev --skip-lock"
99
script:
10-
- "make test lint check-fmt"
10+
- "make test"
11+
- "make lint"
12+
- "make check-fmt"
13+
after_success:
14+
- coveralls

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ APP = app
1515
TEST = tests
1616

1717
test:
18-
$(PYTHON) `which py.test` -s -v $(TEST)
19-
18+
pytest -v $(TEST) --cov-report term --cov-report xml --cov=$(APP)
2019
lint:
2120
pylint $(APP) || true
2221

Pipfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ verify_ssl = true
66
[dev-packages]
77
bandit = "*"
88
black = "==19.10b0"
9+
coveralls = "*"
910
invoke = "*"
1011
isort = "*"
11-
pytest = "*"
1212
pylint = "*"
13+
pytest = "*"
14+
pytest-cov = "*"
1315

1416
[packages]
17+
cachetools = "*"
1518
fastapi = "*"
16-
flask = "*"
17-
python-dotenv = "*"
18-
requests = "*"
1919
gunicorn = "*"
20-
flask-cors = "*"
21-
cachetools = "*"
2220
python-dateutil = "*"
21+
python-dotenv = "*"
22+
requests = "*"
2323
uvicorn = "*"
2424

2525
[requires]

Pipfile.lock

Lines changed: 98 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Provides up-to-date data about Coronavirus outbreak. Includes numbers about conf
66
Support multiple data-sources.
77

88
![Travis build](https://api.travis-ci.com/ExpDev07/coronavirus-tracker-api.svg?branch=master)
9+
[![Coverage Status](https://coveralls.io/repos/github/ExpDev07/coronavirus-tracker-api/badge.svg?branch=master)](https://coveralls.io/github/ExpDev07/coronavirus-tracker-api?branch=master)
910
[![License](https://img.shields.io/github/license/ExpDev07/coronavirus-tracker-api)](LICENSE.md)
1011
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
1112
[![GitHub stars](https://img.shields.io/github/stars/ExpDev07/coronavirus-tracker-api)](https://github.com/ExpDev07/coronavirus-tracker-api/stargazers)

app/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
# See PEP396.
22
__version__ = "2.0"
3-
4-
from .core import create_app

app/core.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/main.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
"""
22
app.main.py
33
"""
4-
import datetime as dt
54
import logging
65
import os
7-
import reprlib
86

97
import pydantic
108
import uvicorn
119
from fastapi import FastAPI, Request, Response
1210
from fastapi.middleware.cors import CORSMiddleware
1311
from fastapi.responses import JSONResponse
1412

15-
from .core import create_app
1613
from .data import data_source
17-
from .models.latest import LatestResponse as Latest
18-
from .models.location import LocationResponse as Location
19-
from .models.location import LocationsResponse as Locations
2014
from .router.v1 import router as v1router
2115
from .router.v2 import router as v2router
2216

0 commit comments

Comments
 (0)