module documentation

Utilities for processing .test files containing test case descriptions.

Class DataDrivenTestCase Holds parsed data-driven test cases, and handles directory setup and teardown.
Class DataFileCollector Represents a single `.test` data driven test file.
Class DataSuite No class docstring; 0/4 class variable, 1/2 method documented
Class DataSuiteCollector No class docstring; 1/1 method documented
Class DeleteFile Undocumented
Class TestItem Parsed test caseitem.
Class UpdateFile Undocumented
Function add_test_name_suffix Undocumented
Function collapse_line_continuation Undocumented
Function expand_errors Transform comments such as '# E: message' or '# E:3: message' in input.
Function expand_variables Undocumented
Function fix_cobertura_filename Changes filename paths to Linux paths in Cobertura output files.
Function fix_win_path Changes Windows paths to Linux paths in error messages.
Function has_stable_flags Undocumented
Function is_incremental Undocumented
Function module_from_path Undocumented
Function parse_test_case Parse and prepare a single case from suite with test case descriptions.
Function parse_test_data Parse a list of lines that represent a sequence of test items.
Function pytest_addoption Undocumented
Function pytest_pycollect_makeitem Called by pytest on each object in modules configured in conftest.py files.
Function split_test_cases Iterate over raw test cases in file, at collection time, ignoring sub items.
Function strip_list Return a stripped copy of l.
Constant SUPPORTED_DEBUGGERS Undocumented
Type Alias FileOperation Undocumented
Variable root_dir Undocumented
def add_test_name_suffix(name: str, suffix: str) -> str: (source)

Undocumented

def collapse_line_continuation(l: list[str]) -> list[str]: (source)

Undocumented

def expand_errors(input: list[str], output: list[str], fnam: str): (source)

Transform comments such as '# E: message' or '# E:3: message' in input. The result is lines like 'fnam:line: error: message'.

def expand_variables(s: str) -> str: (source)

Undocumented

def fix_cobertura_filename(line: str) -> str: (source)

Changes filename paths to Linux paths in Cobertura output files. E.g. filename="pkg\subpkg\a.py" -> filename="pkg/subpkg/a.py".

def fix_win_path(line: str) -> str: (source)

Changes Windows paths to Linux paths in error messages. E.g. foo\bar.py -> foo/bar.py.

def has_stable_flags(testcase: DataDrivenTestCase) -> bool: (source)

Undocumented

def is_incremental(testcase: DataDrivenTestCase) -> bool: (source)

Undocumented

def module_from_path(path: str) -> str: (source)

Undocumented

def parse_test_case(case: DataDrivenTestCase): (source)

Parse and prepare a single case from suite with test case descriptions. This method is part of the setup phase, just before the test case is run.

def parse_test_data(raw_data: str, name: str) -> list[TestItem]: (source)

Parse a list of lines that represent a sequence of test items.

def pytest_addoption(parser: Any): (source)

Undocumented

def pytest_pycollect_makeitem(collector: Any, name: str, obj: object) -> Any|None: (source)

Called by pytest on each object in modules configured in conftest.py files. collector is pytest.Collector, returns Optional[pytest.Class]

def split_test_cases(parent: DataFileCollector, suite: DataSuite, file: str) -> Iterator[DataDrivenTestCase]: (source)

Iterate over raw test cases in file, at collection time, ignoring sub items. The collection phase is slow, so any heavy processing should be deferred to after uninteresting tests are filtered (when using -k PATTERN switch).

def strip_list(l: list[str]) -> list[str]: (source)

Return a stripped copy of l. Strip whitespace at the end of all lines, and strip all empty lines from the end of the array.

SUPPORTED_DEBUGGERS: list[str] = (source)

Undocumented

Value
['gdb', 'lldb']
FileOperation: _TypeAlias = (source)

Undocumented

Value
Union[UpdateFile, DeleteFile]
root_dir = (source)

Undocumented