-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from NellyWhads/test_breakdown
Add support for test breakdown per worker
- Loading branch information
Showing
9 changed files
with
234 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "pytest-xdist-worker-stats" | ||
version = "0.1.6" | ||
version = "0.2.0" | ||
description = "A pytest plugin to list worker statistics after a xdist run." | ||
authors = ["Mikuláš Poul <[email protected]>"] | ||
license = "MIT" | ||
|
@@ -29,8 +29,8 @@ pytest-xdist-worker-stats = "pytest_xdist_worker_stats" | |
|
||
[tool.poetry.dependencies] | ||
python = ">=3.8" | ||
pytest = ">7.3.2" | ||
pytest-xdist = "^3.3" | ||
pytest = ">=7.0.0" | ||
pytest-xdist = ">=3" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
black = "^23.9.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .options import pytest_configure # noqa: F401 | ||
from pytest_xdist_worker_stats.options import pytest_addoption, pytest_configure # noqa: F401 | ||
|
||
__version__ = "0.1.6" | ||
__version__ = "0.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,42 @@ | ||
import pytest | ||
|
||
pytest_plugins = ["pytester"] | ||
|
||
|
||
@pytest.fixture | ||
def sample_testfile(pytester: pytest.Pytester): | ||
code = """ | ||
import pytest | ||
def test_foo(): | ||
pass | ||
@pytest.mark.parametrize("fix1", (1, 2, 3)) | ||
def test_bar(fix1): | ||
pass | ||
""" | ||
pytester.makepyfile(test_plugin=code) | ||
|
||
|
||
expected_header_lines = [ | ||
"*Worker statistics*", | ||
] | ||
|
||
expected_statistics_lines = [ | ||
"Tests : min 2, max 2, average 2.0", | ||
"Runtime : min 0.00s, max 0.00s, average 0.00s", | ||
] | ||
|
||
expected_runtime_lines = [ | ||
"worker gw0 : 2 tests 0.00s runtime", | ||
"worker gw1 : 2 tests 0.00s runtime", | ||
] | ||
|
||
expected_breakdown_lines = [ | ||
"worker gw0 : 2 tests 0.00s runtime", | ||
" test_plugin.py::test_bar[1]", | ||
" test_plugin.py::test_foo", | ||
"worker gw1 : 2 tests 0.00s runtime", | ||
" test_plugin.py::test_bar[2]", | ||
" test_plugin.py::test_bar[3]", | ||
] |
Oops, something went wrong.