Skip to content

Commit 3840f3a

Browse files
committed
Separate unit test and type check Tox jobs. Also use the --lock arg to poetry add to reduce the installation churn.
1 parent 8f07bab commit 3840f3a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tox.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
min_version = 4.0
3-
env_list = format, lint, py{39,310,311}-pydantic{1,2}
3+
env_list = format, lint, py{39,310,311}-pydantic{1,2}-test, py{39,310,311}-pydantic{1,2}-type
44

55
[gh-actions]
66
python =
@@ -11,17 +11,17 @@ python =
1111
[testenv]
1212
labels = core
1313
allowlist_externals = poetry
14-
# The "pydanticX:" prefixes are Tox factor-conditional settings.
14+
# The "pydanticX:", "test:", and "type:" prefixes are Tox factor-conditional settings.
1515
# https://tox.wiki/en/3.4.0/config.html?highlight=conditional#factors-and-factor-conditional-settings
1616
# Note that "poetry add" changes pyproject.toml, but at least we
1717
# change it back when the tests finish.
1818
commands_pre =
19-
pydantic1: poetry add pydantic<2
20-
pydantic2: poetry add pydantic>=1.8
19+
pydantic1: poetry add --lock pydantic<2
20+
pydantic2: poetry add --lock pydantic>=1.8
2121
poetry install --no-root --all-extras
2222
commands =
23-
poetry run pytest -vv tests
24-
poetry run mypy openapi_pydantic tests
23+
test: poetry run pytest -vv tests
24+
type: poetry run mypy openapi_pydantic tests
2525

2626
[testenv:format]
2727
allowlist_externals = poetry

0 commit comments

Comments
 (0)