ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

Collect test outcomes and render configured console feedback.

Method __createTestResult Create and return a TestResult instance for the given test.
Method __extractTraceInfo Extract formatted traceback and highlighted source lines for a test failure.
Method __init__ Initialize the TestResultProcessor instance.
Method __printTestResult Print a test outcome at the configured verbosity.
Method addError Record an errored test result and print it.
Method addExpectedFailure Report an expected failure as a skipped outcome.
Method addFailure Record a failed test result and print it.
Method addSkip Record a skipped test result and print it.
Method addSubTest Record a failed subtest in both native and exported results.
Method addSuccess Record a successful test result and print it.
Method addUnexpectedSuccess Report an unexpected success as a failed outcome.
Method getTestResults Retrieve the list of test results collected during execution.
Method startTest Start timing for a test case execution.
Method stopTest Clear the active timer after completing a test.
Instance Variable __console Console produced by Console.
Instance Variable __max_width Maximum width used when rendering test-result panels.
Instance Variable __print_verbosity 1 prints one compact line per test and 2 prints a detailed panel. Any other value, including None, prints nothing. Supplied by the runner through unittest.TextTestRunner._makeResult, by default None.
Instance Variable __start_time Start time of the active test, or None between test methods.
Instance Variable __test_results Structured outcomes collected during the current test run.
def __createTestResult(self, test: unittest.case.TestCase, status: TestStatus, exc_info: tuple[type[BaseException], BaseException, object] | None = None, *, subtest: unittest.case.TestCase | None = None) -> TestResult: (source)

Create and return a TestResult instance for the given test.

Parameters
test:unittest.TestCaseThe test case instance being processed.
status:orionis.test.enums.status.TestStatusThe status of the test (e.g., PASSED, FAILED).
exc_info:tuple[type[BaseException], BaseException, object] or None, optionalException info tuple as returned by sys.exc_info(), by default None.
subtest:unittest.TestCase or None, optionalSubtest whose identity replaces the parent identity in the report.
Returns
orionis.test.entities.result.TestResultThe constructed TestResult object containing test outcome details.
def __extractTraceInfo(self, exc_info: tuple[type[BaseException], BaseException, object], file_path: str | None) -> tuple[list[str], list[tuple[int, str]], int | None]: (source)

Extract formatted traceback and highlighted source lines for a test failure.

Parameters
exc_info:tupleException info tuple as returned by sys.exc_info().
file_path:str or NoneAbsolute path of the test source file used to filter stack frames.
Returns
tupleA three-element tuple of (traceback_lines, source_code_pairs, line_no).
def __init__(self, stream: object = None, descriptions: object = None, verbosity: int | None = None, **kwargs: object): (source)

Initialize the TestResultProcessor instance.

Parameters
stream:object, optionalOutput stream forwarded to the superclass, by default None.
descriptions:object, optionalDescription flag forwarded to the superclass, by default None.
verbosity:int | None, optionalDetail level used to print every recorded outcome: 1 prints one compact line per test and 2 prints a detailed panel. Any other value, including None, prints nothing. Supplied by the runner through unittest.TextTestRunner._makeResult, by default None.
**kwargs:objectAdditional keyword arguments forwarded to the superclass.
Returns
NoneNo return value.
def __printTestResult(self, result: TestResult): (source)

Print a test outcome at the configured verbosity.

Parameters
result:orionis.test.entities.result.TestResultThe test result instance to display.
Returns
NoneNo return value.
def addError(self, test: unittest.case.TestCase, err: tuple[type[BaseException], BaseException, object]): (source)

Record an errored test result and print it.

Parameters
test:unittest.TestCaseThe test case instance that errored.
err:tuple[type[BaseException], BaseException, object]The exception info tuple for the error.
Returns
NoneNo return value.
def addExpectedFailure(self, test: unittest.case.TestCase, err: tuple[type[BaseException], BaseException, object]): (source)

Report an expected failure as a skipped outcome.

Parameters
test:unittest.TestCaseTest marked as an expected failure.
err:tupleException details retained for diagnostics.
Returns
NoneComplete the documented operation without returning a value.
def addFailure(self, test: unittest.case.TestCase, err: tuple[type[BaseException], BaseException, object]): (source)

Record a failed test result and print it.

Parameters
test:unittest.TestCaseThe test case instance that failed.
err:tuple[type[BaseException], BaseException, object]The exception info tuple for the failure.
Returns
NoneNo return value.
def addSkip(self, test: unittest.case.TestCase, reason: str): (source)

Record a skipped test result and print it.

Parameters
test:unittest.TestCaseThe test case instance that was skipped.
reason:strThe reason for skipping the test.
Returns
NoneNo return value.
def addSubTest(self, test: unittest.case.TestCase, subtest: unittest.case.TestCase, err: tuple[type[BaseException], BaseException, object] | None): (source)

Record a failed subtest in both native and exported results.

Parameters
test:unittest.TestCaseParent test providing source and method metadata.
subtest:unittest.TestCaseSubtest providing its parameterized identifier.
err:tuple or NoneException details, or None when the subtest passed.
Returns
NoneComplete the documented operation without returning a value.
def addSuccess(self, test: unittest.case.TestCase): (source)

Record a successful test result and print it.

Parameters
test:unittest.TestCaseThe test case instance that succeeded.
Returns
NoneNo return value.
def addUnexpectedSuccess(self, test: unittest.case.TestCase): (source)

Report an unexpected success as a failed outcome.

Parameters
test:unittest.TestCaseTest that passed despite its expected-failure marker.
Returns
NoneComplete the documented operation without returning a value.
def getTestResults(self) -> list[TestResult]: (source)

Retrieve the list of test results collected during execution.

Returns
list[orionis.test.entities.result.TestResult]A list of TestResult instances representing the outcomes of executed tests.
def startTest(self, test: unittest.case.TestCase): (source)

Start timing for a test case execution.

Parameters
test:unittest.TestCaseThe test case instance being started.
Returns
NoneNo return value.
def stopTest(self, test: unittest.case.TestCase): (source)

Clear the active timer after completing a test.

Parameters
test:unittest.TestCaseTest whose execution has finished.
Returns
NoneNo return value.
__console = (source)

Console produced by Console.

__max_width = (source)

Maximum width used when rendering test-result panels.

__print_verbosity: int | None = (source)

1 prints one compact line per test and 2 prints a detailed panel. Any other value, including None, prints nothing. Supplied by the runner through unittest.TextTestRunner._makeResult, by default None.

__start_time: float | None = (source)

Start time of the active test, or None between test methods.

__test_results: list[TestResult] = (source)

Structured outcomes collected during the current test run.