Skip to content

Commit 0073f0f

Browse files
committed
Add tox.ini file
Currently, when testing codespell on a local system, it is necessary to first install the package manually. Add a tox file to improve user experience and ensure each step runs in an isolated environment. There are two changes, compared to the current workflow: - pytest runs with coverage enabled - the package is not installed in editable mode Additionally, for convenience, there is a step testing the dictionaries. Update .coveragerc to exclude the .tox directory.
1 parent 5facd6f commit 0073f0f

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.coveragerc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
[run]
22
branch = True
33
source = codespell_lib
4-
omit = */codespell_lib/tests/*
4+
omit =
5+
*/codespell_lib/tests/*
6+
*/.tox/*

tox.ini

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[tox]
2+
min_version = 4.0
3+
env_list = unitest,type,dictionaries
4+
5+
[testenv:unitest]
6+
description = run unit tests
7+
extras = dev
8+
commands = pytest --cov=codespell_lib codespell_lib
9+
10+
[testenv:type]
11+
description = run type checks
12+
extras = types
13+
commands = mypy codespell_lib
14+
15+
[testenv:dictionaries]
16+
description = run dictionary checks
17+
skip_install = true
18+
allowlist_externals = make
19+
# Since pytest is not installed in this environment, we can avoid testing
20+
# test_dictionary.py again.
21+
commands = make check-dictionaries

0 commit comments

Comments
 (0)