Commit 8794f349 by Bjorn Neergaard

tests: speed up pytest with default parallelism

This breaks sugar's output, so we drop it.

We also speed up test collection by defining pytest's testpaths.
parent 1f9c00fc
...@@ -103,13 +103,13 @@ jobs: ...@@ -103,13 +103,13 @@ jobs:
run: poetry run pip install pytest-github-actions-annotate-failures run: poetry run pip install pytest-github-actions-annotate-failures
- name: Run pytest - name: Run pytest
run: poetry run python -m pytest -n auto -p no:sugar -q tests/ run: poetry run pytest -v tests/
- name: Run pytest (integration suite) - name: Run pytest (integration suite)
env: env:
POETRY_TEST_INTEGRATION_GIT_USERNAME: ${GITHUB_ACTOR} POETRY_TEST_INTEGRATION_GIT_USERNAME: ${GITHUB_ACTOR}
POETRY_TEST_INTEGRATION_GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }} POETRY_TEST_INTEGRATION_GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: poetry run python -m pytest -n auto -p no:sugar -q --integration tests/integration run: poetry run pytest -v --integration tests/integration
- name: Get Plugin Version (poetry-plugin-export) - name: Get Plugin Version (poetry-plugin-export)
id: poetry-plugin-export-version id: poetry-plugin-export-version
...@@ -125,7 +125,7 @@ jobs: ...@@ -125,7 +125,7 @@ jobs:
ref: refs/tags/${{ steps.poetry-plugin-export-version.outputs.version }} ref: refs/tags/${{ steps.poetry-plugin-export-version.outputs.version }}
- name: Run pytest (poetry-plugin-export) - name: Run pytest (poetry-plugin-export)
run: poetry run python -m pytest -p no:sugar -q poetry-plugin-export/tests/ run: poetry run pytest -v poetry-plugin-export/tests/
- name: Check for clean working tree - name: Check for clean working tree
run: | run: |
......
...@@ -688,19 +688,6 @@ importlib-metadata = {version = ">=3.6.0", markers = "python_version < \"3.10\"" ...@@ -688,19 +688,6 @@ importlib-metadata = {version = ">=3.6.0", markers = "python_version < \"3.10\""
pytest = "*" pytest = "*"
[[package]] [[package]]
name = "pytest-sugar"
version = "0.9.5"
description = "pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly)."
category = "dev"
optional = false
python-versions = "*"
[package.dependencies]
packaging = ">=14.1"
pytest = ">=2.9"
termcolor = ">=1.1.0"
[[package]]
name = "pytest-xdist" name = "pytest-xdist"
version = "2.5.0" version = "2.5.0"
description = "pytest xdist plugin for distributed testing and loop-on-failing modes" description = "pytest xdist plugin for distributed testing and loop-on-failing modes"
...@@ -806,17 +793,6 @@ optional = false ...@@ -806,17 +793,6 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
[[package]] [[package]]
name = "termcolor"
version = "2.0.1"
description = "ANSI color formatting for output in terminal"
category = "dev"
optional = false
python-versions = ">=3.7"
[package.extras]
tests = ["pytest", "pytest-cov"]
[[package]]
name = "toml" name = "toml"
version = "0.10.2" version = "0.10.2"
description = "Python Library for Tom's Obvious, Minimal Language" description = "Python Library for Tom's Obvious, Minimal Language"
...@@ -964,7 +940,7 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= ...@@ -964,7 +940,7 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>=
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.7" python-versions = "^3.7"
content-hash = "397d0baecf1ea5fc65213751385260af571e5c339ce62ff34a5cb7b48d185d0d" content-hash = "4a92037b2aea6f5648198caac9c2022c56e8f61cf3c52a9f47802b7be6ee56bd"
[metadata.files] [metadata.files]
attrs = [ attrs = [
...@@ -1481,10 +1457,6 @@ pytest-randomly = [ ...@@ -1481,10 +1457,6 @@ pytest-randomly = [
{file = "pytest-randomly-3.12.0.tar.gz", hash = "sha256:d60c2db71ac319aee0fc6c4110a7597d611a8b94a5590918bfa8583f00caccb2"}, {file = "pytest-randomly-3.12.0.tar.gz", hash = "sha256:d60c2db71ac319aee0fc6c4110a7597d611a8b94a5590918bfa8583f00caccb2"},
{file = "pytest_randomly-3.12.0-py3-none-any.whl", hash = "sha256:f4f2e803daf5d1ba036cc22bf4fe9dbbf99389ec56b00e5cba732fb5c1d07fdd"}, {file = "pytest_randomly-3.12.0-py3-none-any.whl", hash = "sha256:f4f2e803daf5d1ba036cc22bf4fe9dbbf99389ec56b00e5cba732fb5c1d07fdd"},
] ]
pytest-sugar = [
{file = "pytest-sugar-0.9.5.tar.gz", hash = "sha256:eea78b6f15b635277d3d90280cd386d8feea1cab0f9be75947a626e8b02b477d"},
{file = "pytest_sugar-0.9.5-py2.py3-none-any.whl", hash = "sha256:3da42de32ce4e1e95b448d61c92804433f5d4058c0a765096991c2e93d5a289f"},
]
pytest-xdist = [ pytest-xdist = [
{file = "pytest-xdist-2.5.0.tar.gz", hash = "sha256:4580deca3ff04ddb2ac53eba39d76cb5dd5edeac050cb6fbc768b0dd712b4edf"}, {file = "pytest-xdist-2.5.0.tar.gz", hash = "sha256:4580deca3ff04ddb2ac53eba39d76cb5dd5edeac050cb6fbc768b0dd712b4edf"},
{file = "pytest_xdist-2.5.0-py3-none-any.whl", hash = "sha256:6fe5c74fec98906deb8f2d2b616b5c782022744978e7bd4695d39c8f42d0ce65"}, {file = "pytest_xdist-2.5.0-py3-none-any.whl", hash = "sha256:6fe5c74fec98906deb8f2d2b616b5c782022744978e7bd4695d39c8f42d0ce65"},
...@@ -1559,10 +1531,6 @@ six = [ ...@@ -1559,10 +1531,6 @@ six = [
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
] ]
termcolor = [
{file = "termcolor-2.0.1-py3-none-any.whl", hash = "sha256:7e597f9de8e001a3208c4132938597413b9da45382b6f1d150cff8d062b7aaa3"},
{file = "termcolor-2.0.1.tar.gz", hash = "sha256:6b2cf769e93364a2676e1de56a7c0cff2cf5bd07f37e9cc80b0dd6320ebfe388"},
]
toml = [ toml = [
{file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"},
{file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},
......
...@@ -78,7 +78,6 @@ pytest = "^7.1" ...@@ -78,7 +78,6 @@ pytest = "^7.1"
pytest-cov = "^4.0" pytest-cov = "^4.0"
pytest-mock = "^3.9" pytest-mock = "^3.9"
pytest-randomly = "^3.12" pytest-randomly = "^3.12"
pytest-sugar = "^0.9"
pytest-xdist = { version = "^2.5", extras = ["psutil"] } pytest-xdist = { version = "^2.5", extras = ["psutil"] }
pre-commit = "^2.6" pre-commit = "^2.6"
deepdiff = "^5.0" deepdiff = "^5.0"
...@@ -166,6 +165,14 @@ module = [ ...@@ -166,6 +165,14 @@ module = [
] ]
ignore_missing_imports = true ignore_missing_imports = true
[tool.pytest.ini_options]
addopts = "-n auto"
testpaths = [
"tests"
]
[tool.coverage.report] [tool.coverage.report]
exclude_lines = [ exclude_lines = [
"pragma: no cover", "pragma: no cover",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment