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

class TestingEngine(ITestingEngine): (source)

Constructor: TestingEngine(app)

View In Hierarchy

Discover configured tests, execute them and persist optional result caches.

Method __extractTests Extract individual test cases from a test suite recursively.
Method __init__ Initialize the TestingEngine with application configuration.
Method __saveCache Save test results to an independent JSON cache file.
Method __testFiles Yield matching Python files without traversing an explicit file path.
Method discover Discover and filter tests using configuration parameters.
Async Method run Run the discovered test suite asynchronously.
Method setFailFast Set the fail-fast behavior for the testing engine.
Method setFilePattern Set the file pattern for test file discovery.
Method setMethodPattern Set the method pattern for test method discovery.
Method setStartDir Set the directory or Python file used for test discovery.
Method setVerbosity Set the verbosity level for the testing engine.
Method withoutPanel Disable the start panel display for the testing engine.
Instance Variable __base_path Retrieve configuration values from the application instance.
Instance Variable __cache_folder Directory used to persist structured test-run results.
Instance Variable __fail_fast Whether the test run stops after the first failure.
Instance Variable __file_pattern Filename pattern selecting modules for test discovery.
Instance Variable __json_cache Json cache produced by bool.
Instance Variable __method_pattern Method-name pattern selecting test cases.
Instance Variable __start_dir Directory from which test discovery begins.
Instance Variable __verbosity Configured detail level for test-runner output.
Instance Variable __with_panel With panel flag used by TestingEngine.
def __extractTests(self, test_suite: unittest.TestSuite) -> Generator[unittest.TestCase]: (source)

Extract individual test cases from a test suite recursively.

Parameters
test_suite:unittest.TestSuiteTest suite to extract test cases from.
Yields
unittest.TestCaseIndividual test case contained in the suite.
def __init__(self, app: IApplication): (source)

Initialize the TestingEngine with application configuration.

Every testing.* key that is absent from the application configuration resolves to None and is replaced by the default declared in orionis.foundation.config.testing.Testing, so discovery never receives a missing value.

Parameters
app:orionis.IApplicationApplication instance providing configuration values.
Returns
NoneThis method does not return a value.
def __saveCache(self, results: list[TestResult]): (source)

Save test results to an independent JSON cache file.

Parameters
results:list[orionis.test.entities.result.TestResult]List of test results to save.
Returns
NoneThis method does not return a value.
def __testFiles(self, start_path: Path) -> Generator[Path]: (source)

Yield matching Python files without traversing an explicit file path.

Parameters
start_path:pathlib.PathExisting directory or Python file selected for discovery.
Yields
pathlib.PathFile to import as a test module.
Raises
ValueErrorIf an explicitly selected file does not have a Python extension.
OSErrorIf the discovery tree cannot be read.
def discover(self) -> unittest.TestSuite: (source)

Discover and filter tests using configuration parameters.

Returns
unittest.TestSuiteTest suite containing filtered test cases.
Raises
OSErrorIf the selected path is absent or a directory cannot be read.
ValueErrorIf the selected path is outside the application or is not Python.
ImportErrorIf a matching module was imported from another project directory.
ExceptionIf a test module raises an exception outside loader error handling.
async def run(self) -> list[TestResult]: (source)

Run the discovered test suite asynchronously.

Discovers the tests, builds a runner carrying the configured verbosity, and executes them using a thread pool to avoid blocking. Saves results to cache if enabled.

Returns
list[orionis.test.entities.result.TestResult]List of TestResult objects containing test execution outcomes.
def setFailFast(self, *, fail_fast: bool) -> Self: (source)

Set the fail-fast behavior for the testing engine.

Parameters
fail_fast:boolWhether to stop on first failure.
Returns
typing.SelfReturns self for method chaining.
def setFilePattern(self, file_pattern: str) -> Self: (source)

Set the file pattern for test file discovery.

Parameters
file_pattern:strPattern to match test files.
Returns
typing.SelfReturns self for method chaining.
def setMethodPattern(self, method_pattern: str) -> Self: (source)

Set the method pattern for test method discovery.

Parameters
method_pattern:strPattern to match test methods.
Returns
typing.SelfReturns self for method chaining.
def setStartDir(self, start_dir: str) -> Self: (source)

Set the directory or Python file used for test discovery.

Parameters
start_dir:strDirectory or Python file, relative to the application root when not absolute.
Returns
typing.SelfReturns self for method chaining.
def setVerbosity(self, verbosity: int) -> Self: (source)

Set the verbosity level for the testing engine.

Parameters
verbosity:intVerbosity level to set.
Returns
typing.SelfReturns self for method chaining.
def withoutPanel(self) -> Self: (source)

Disable the start panel display for the testing engine.

Returns
typing.SelfReturns self for method chaining.
__base_path: Path = (source)

Retrieve configuration values from the application instance.

__cache_folder: Path = (source)

Directory used to persist structured test-run results.

__fail_fast: bool = (source)

Whether the test run stops after the first failure.

__file_pattern: str = (source)

Filename pattern selecting modules for test discovery.

__json_cache: bool = (source)

Json cache produced by bool.

__method_pattern: str = (source)

Method-name pattern selecting test cases.

__start_dir: str = (source)

Directory from which test discovery begins.

__verbosity: int = (source)

Configured detail level for test-runner output.

__with_panel: bool = (source)

With panel flag used by TestingEngine.