mirror of
https://github.com/jongracecox/anybadge.git
synced 2026-01-05 03:41:08 +01:00
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:
8
docker/test/Dockerfile
Normal file
8
docker/test/Dockerfile
Normal 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 ./
|
||||
4
docker/test/requirements.txt
Normal file
4
docker/test/requirements.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
packaging
|
||||
pytest
|
||||
pytest-cov
|
||||
requests
|
||||
7
docker/test/run_docker_tests.sh
Executable file
7
docker/test/run_docker_tests.sh
Executable 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
|
||||
Reference in New Issue
Block a user