Skip to content

Commit 8525b3a

Browse files
committed
switch to pytest
1 parent e76c61a commit 8525b3a

File tree

6 files changed

+165
-34
lines changed

6 files changed

+165
-34
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uv sync --locked
2020
- name: Run coverage
2121
run: |
22-
coverage run -m nose
22+
coverage run -m pytest
2323
# .coverage.* files are ignored by git
2424
coverage report -m | tee .coverage.out
2525
percent=$(grep -E '^TOTAL\s.+\s[0-9]{1,3}%$' .coverage.out \

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
"HOST":"localhost",
5858
"PORT":"5432"
5959
}
60-
run: nosetests -v --with-coverage --cover-branches --cover-package=field_audit
60+
run: pytest --cov=field_audit --cov-branch -v
6161
continue-on-error: ${{ matrix.experimental }}
6262
- name: Check migrations
6363
run: |

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ your local Python's `sqlite3` library ships with the `JSON1` extension enabled
258258

259259
- Tests
260260
```shell
261-
uv run nosetests
261+
uv run pytest
262262
```
263263

264264
- Style check
@@ -268,7 +268,7 @@ your local Python's `sqlite3` library ships with the `JSON1` extension enabled
268268

269269
- Coverage
270270
```shell
271-
uv run coverage run -m nose
271+
uv run coverage run -m pytest
272272
uv run coverage report -m
273273
```
274274

@@ -292,7 +292,6 @@ Publishing is automated with [Github Actions](.github/workflows/pypi.yml).
292292
- Implement auditing for the remaining "special" QuerySet write operations:
293293
- `bulk_update()`
294294
- Write full library documentation using github.io.
295-
- Switch to `pytest` to support Python 3.10.
296295

297296
### Backlog
298297

pyproject.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,18 @@ name = "field_audit"
3939
[tool.uv]
4040
dev-dependencies = [
4141
"coverage",
42-
"pynose",
42+
"pytest",
43+
"pytest-cov",
44+
"pytest-django",
4345
"ruff",
4446
]
4547

48+
[tool.pytest.ini_options]
49+
DJANGO_SETTINGS_MODULE = "tests.settings"
50+
addopts = "--tb=short --strict-markers --strict-config"
51+
python_files = ["tests.py", "test_*.py", "*_test.py"]
52+
testpaths = ["tests"]
53+
4654
[build-system]
4755
requires = ["flit_core >=3.2,<4"]
4856
build-backend = "flit_core.buildapi"

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def setup():
13-
"""Initialize database for nosetests"""
13+
"""Initialize database for pytest"""
1414
init_db()
1515

1616

0 commit comments

Comments
 (0)