Add package testing to CI (#68)

* Make `build_examples.py` callable from python
* Allow tests to run from outside project directory
* Add invoke tasks
* Add server tests
* Run travis tests against wheel package instead of local code
* Update `badge.write_badge()` to support `pathlib.Path`
* Update `CONTRIBUTING.md`
This commit is contained in:
Jon Grace-Cox
2022-08-13 13:22:15 -04:00
committed by GitHub
parent 9b7318417d
commit 1c986d4ad8
15 changed files with 308 additions and 34 deletions

8
docker/test/Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM python:3.10.0
WORKDIR /work
RUN apt update && pip install -U pip
COPY requirements.txt ./
RUN pip install -r ./requirements.txt
COPY run_docker_tests.sh ./

View File

@@ -0,0 +1,4 @@
packaging
pytest
pytest-cov
requests

View File

@@ -0,0 +1,7 @@
#!/bin/bash
echo "Running tests..."
mkdir tmp && cd tmp
mkdir tests
pip install /app/dist/anybadge*.whl
pytest --doctest-modules --cov=anybadge --cov-report html:htmlcov /app/anybadge /app/tests