This commit is contained in:
Iliyan Angelov
2025-12-06 03:27:35 +02:00
parent 7667eb5eda
commit 5a8ca3c475
2211 changed files with 28086 additions and 37066 deletions

View File

@@ -1,22 +1,23 @@
"""Helper plugin for pytester; should not be loaded on its own."""
# This plugin contains assertions used by pytester. pytester cannot
# contain them itself, since it is imported by the `pytest` module,
# hence cannot be subject to assertion rewriting, which requires a
# module to not be already imported.
from __future__ import annotations
from collections.abc import Sequence
from typing import Dict
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Union
from _pytest.reports import CollectReport
from _pytest.reports import TestReport
def assertoutcome(
outcomes: tuple[
outcomes: Tuple[
Sequence[TestReport],
Sequence[CollectReport | TestReport],
Sequence[CollectReport | TestReport],
Sequence[Union[CollectReport, TestReport]],
Sequence[Union[CollectReport, TestReport]],
],
passed: int = 0,
skipped: int = 0,
@@ -35,15 +36,15 @@ def assertoutcome(
def assert_outcomes(
outcomes: dict[str, int],
outcomes: Dict[str, int],
passed: int = 0,
skipped: int = 0,
failed: int = 0,
errors: int = 0,
xpassed: int = 0,
xfailed: int = 0,
warnings: int | None = None,
deselected: int | None = None,
warnings: Optional[int] = None,
deselected: Optional[int] = None,
) -> None:
"""Assert that the specified outcomes appear with the respective
numbers (0 means it didn't occur) in the text output from a test run."""