Merge pull request #782 from FozzieHi/unit-tests
Improve and refactor testing.
This commit is contained in:
commit
68acfc986a
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -65,7 +65,7 @@ jobs:
|
||||||
|
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
pytest --cov=. --cov-report=term:skip-covered --cov-report=html:htmlcov --cov-fail-under=60
|
pytest
|
||||||
|
|
||||||
- name: Archive code coverage results
|
- name: Archive code coverage results
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
|
10
coverage.ini
Normal file
10
coverage.ini
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[run]
|
||||||
|
branch = True
|
||||||
|
source = .
|
||||||
|
|
||||||
|
[report]
|
||||||
|
fail_under = 55
|
||||||
|
omit =
|
||||||
|
app/fake_data.py
|
||||||
|
oauth_tester.py
|
||||||
|
skip_covered = True
|
5
pytest.ini
Normal file
5
pytest.ini
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[pytest]
|
||||||
|
addopts =
|
||||||
|
--cov
|
||||||
|
--cov-config coverage.ini
|
||||||
|
--cov-report=html:htmlcov
|
|
@ -5,7 +5,7 @@ docker rm -f sl-test-db
|
||||||
docker run -d --name sl-test-db -e POSTGRES_PASSWORD=test -e POSTGRES_USER=test -e POSTGRES_DB=test -p 15432:5432 postgres:13
|
docker run -d --name sl-test-db -e POSTGRES_PASSWORD=test -e POSTGRES_USER=test -e POSTGRES_DB=test -p 15432:5432 postgres:13
|
||||||
|
|
||||||
# the time the DB container starts
|
# the time the DB container starts
|
||||||
sleep 5
|
sleep 3
|
||||||
|
|
||||||
poetry run pytest
|
poetry run pytest
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue