Skip to content

Commit 5734f72

Browse files
committed
Add testing infrastructure (pytest, GitHub Action)
1 parent 7e89b0f commit 5734f72

4 files changed

Lines changed: 106 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
# Allow manual workflow triggering from the "Actions" tab.
9+
workflow_dispatch:
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ['3.11', '3.12']
19+
20+
steps:
21+
- name: Check out repository
22+
uses: actions/checkout@v4
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v3
26+
with:
27+
version: "0.4.29"
28+
enable-cache: true
29+
cache-dependency-glob: "uv.lock"
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Install project
37+
run: uv sync --frozen --only-group test
38+
39+
- name: Run tests
40+
run: |
41+
uv run pytest tests

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
- Changed type of ``Series`` fields ``alternative_names``,
99
``country_codes`` from ``set[str]`` to ``list[str]``.
1010

11+
- Added testing infrastructure (pytest, GitHub Action).
12+
1113
- Added ruff as a development dependency.
1214

1315

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ build-backend = "hatchling.build"
3030
dev = [
3131
"ruff>=0.7.2",
3232
]
33+
test = [
34+
"pytest>=8.3.3",
35+
]
36+
37+
[tool.pytest.ini_options]
38+
addopts = [
39+
"--import-mode=importlib",
40+
]
3341

3442
[tool.ruff.format]
3543
quote-style = "single"

uv.lock

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)