Skip to content

Commit fbd5726

Browse files
authored
Merge pull request #5 from darjeeling/main
init github action testing
2 parents 5e4eb15 + 1e34dd4 commit fbd5726

File tree

4 files changed

+139
-2
lines changed

4 files changed

+139
-2
lines changed

.github/workflows/testing.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# The name of the action
2+
name: pao web site backend testing
3+
# When the action is triggered
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
# What to do when the action is triggered
13+
jobs:
14+
testing:
15+
# Run on a Ubuntu VM
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
22+
23+
- name: Install the project
24+
run: uv sync --all-extras --dev
25+
26+
- name: Run tests
27+
run: uv run pytest
28+

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,18 @@ dependencies = [
1313
"wagtail>=6.4.1",
1414
"wagtail-bakery>=0.8.0",
1515
]
16+
17+
[tool.pytest.ini_options]
18+
DJANGO_SETTINGS_MODULE = "pythonkr_backend.settings"
19+
pythonpath = ["pythonkr_backend"]
20+
testpaths = [
21+
"pythonkr_backend/pythonkr_backend",
22+
"pythonkr_backend/pythonkr",
23+
]
24+
python_files = ["tests.py", "test_*.py", "*_tests.py"]
25+
26+
[dependency-groups]
27+
dev = [
28+
"pytest-django>=4.10.0",
29+
"ruff>=0.9.10",
30+
]

pythonkr_backend/pythonkr/tests.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
from django.test import TestCase
1+
import pytest
22

3-
# Create your tests here.
3+
4+
@pytest.mark.django_db
5+
def test_example():
6+
assert 1 == 1

uv.lock

Lines changed: 91 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)