test: Add tox testing

Add `tox.ini` config with supported versions, and a new tox CI
workflow to run tox tests on master branch changes. This is "expensive"
so we may consider limiting execution further.
This commit is contained in:
Jon Grace-Cox
2024-12-30 08:25:01 -05:00
committed by Jon Grace-Cox
parent 43a4bea37c
commit e6318f3446
5 changed files with 52 additions and 1 deletions

32
.github/workflows/tox.yaml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Run Tox Tests
on:
push:
branches:
- master # Run only on the master branch
jobs:
test:
name: Test with Tox
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run Tox
run: tox -e py${{ matrix.python-version }}

View File

@@ -216,6 +216,15 @@ inv package.build && inv package.install && inv test.cli
Note that this will force install the built wheel from the project `dist/` directory over any existing local install.
### Tox tests
To run tox tests against all supported Python versions:
```bash
pip install tox
tox
```
## Documentation
The `README.md` file contains a table showing example badges for the different built-in colors. If you modify the

View File

@@ -13,7 +13,7 @@ Python project for generating badges for your projects
[![buymeacoffee](https://camo.githubusercontent.com/c3f856bacd5b09669157ed4774f80fb9d8622dd45ce8fdf2990d3552db99bd27/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/jongracecox)
Supports: Python 3.7-3.9 (2.7-3.6 support has been dropped)
Supports: Python 3.7-3.13 (2.7-3.6 support has been dropped)
## Overview

View File

@@ -5,5 +5,6 @@ pytest
pytest-cov
requests
setuptools
tox
types-requests
wheel

9
tox.ini Normal file
View File

@@ -0,0 +1,9 @@
[tox]
envlist = py37, py38, py39, py310, py311, py312, py313
[testenv]
deps =
pytest
-rbuild-requirements.txt
commands =
pytest --doctest-modules anybadge tests