Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml

- name: Install package with test dependencies
run: python -m pip install -e '.[dev]'

- name: Run offline test suite
run: python -m pytest -q
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,29 @@ except (ServerError, TimeoutError_):
raise
```

## Tests
## Entwicklung und Tests

Die Tests benötigen die optionale Dev-Abhängigkeit `requests-mock`. Installiere
das Paket deshalb im Entwicklungsmodus mit dem `dev`-Extra, bevor du `pytest`
ausführst:

```bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
python -m pytest -q
```

Optional mit Coverage:

```bash
.venv/bin/pytest
.venv/bin/pytest --cov=briefklick
python -m pytest --cov=briefklick
```

Ein nacktes `python -m pytest` in einer Umgebung ohne `.[dev]` schlägt fehl,
weil `requests-mock` nur für Tests gebraucht wird und nicht zu den
Laufzeit-Abhängigkeiten gehört.

Alle Tests laufen offline. `requests-mock` fängt sämtliche HTTP-Aufrufe ab, ein
API-Key ist für die Tests nicht nötig.

Expand Down