2.1.1. tests.conftest

2.1.1.1. Attributes

logger

2.1.1.2. Functions

_compute_run_paths(config)

Create a unique run directory and return run metadata dict.

_load_target_plugin(config)

Dynamically import target plugin (e.g., for FVP) if selected.

_apply_debug_logging(config)

Enable CLI logging if --debug-logs was passed.

_prepare_bundle_paths(pytestconfig, bundle)

Ensure bundle paths (manager + driver) are set up; return run paths dict.

_power_on(bundle, ptype, plat)

Bring the platform up and wait until ready.

_cleanup_manager(mgr)

Best-effort session cleanup on the manager.

_power_off(bundle)

Attempt graceful power-off and session cleanup.

pytest_configure(config)

Configure pytest logging and conditionally load target plugins.

cfg(pytestconfig)

Load the YAML configuration once per test session.

_available_platform_names(cfg)

Return a list of platform 'name' values from cfg.platforms, or an empty

_apply_cfg2_overrides(platform_config)

Temporarily inject cfg2 specific configs before boot.

auto_platform_config_data(pytestconfig, cfg)

Resolve and return the selected platform dictionary from the YAML config.

platform_bundle(pytestconfig, cfg, ...)

Build the platform bundle once from the config.

platform_driver(platform_bundle)

Provide the platform driver object for tests.

session_manager(platform_bundle)

Provide the session/console manager for tests.

platform_name(platform_base_obj, cfg)

Normalize the selected platform name to a canonical short name.

platform_base_obj(session_manager, ...)

Construct the base platform helper object once per session.

fpga_device(request)

Session-scoped FPGA device fixture.

pytest_addoption(parser)

Register custom CLI options used by the test framework.

_get_cfg2_si_cluster1_prompt()

Return the expected prompt for si_cluster1 based on build type.

2.1.1.3. Module Contents

tests.conftest.logger[source]
tests.conftest._compute_run_paths(config)[source]

Create a unique run directory and return run metadata dict.

Parameters:
  • pytestconfig – Pytest configuration object.

  • config (pytest.Config)

Returns:

Dictionary.

Return type:

dict

tests.conftest._load_target_plugin(config)[source]

Dynamically import target plugin (e.g., for FVP) if selected.

Parameters:
  • pytestconfig – Pytest configuration object.

  • config (pytest.Config)

Returns:

None.

Return type:

None

tests.conftest._apply_debug_logging(config)[source]

Enable CLI logging if –debug-logs was passed.

Parameters:
  • pytestconfig – Pytest configuration object.

  • config (pytest.Config)

Returns:

None.

Return type:

None

tests.conftest._prepare_bundle_paths(pytestconfig, bundle)[source]

Ensure bundle paths (manager + driver) are set up; return run paths dict.

If pytest_configure already created run paths, reuse them; otherwise, compute a fallback here.

Parameters:
Return type:

dict

tests.conftest._power_on(bundle, ptype, plat)[source]

Bring the platform up and wait until ready.

Parameters:
Return type:

None

tests.conftest._cleanup_manager(mgr)[source]

Best-effort session cleanup on the manager.

Return type:

None

tests.conftest._power_off(bundle)[source]

Attempt graceful power-off and session cleanup.

Parameters:

bundle (test_automation.targets.registry.DriverBundle)

Return type:

None

tests.conftest.pytest_configure(config)[source]

Configure pytest logging and conditionally load target plugins.

Parameters:

config (pytest.Config) – Pytest configuration object.

Returns:

None.

Return type:

None

tests.conftest.cfg(pytestconfig)[source]

Load the YAML configuration once per test session.

Parameters:

pytestconfig (pytest.Config) – Pytest configuration object.

Returns:

Parsed Config instance.

Return type:

test_automation.configs.config.Config

tests.conftest._available_platform_names(cfg)[source]

Return a list of platform ‘name’ values from cfg.platforms, or an empty list if cfg.platforms is not present.

Parameters:

cfg (test_automation.configs.config.Config) – Parsed configuration object.

Returns:

List of platform names defined in the configuration.

Return type:

list

tests.conftest._apply_cfg2_overrides(platform_config)[source]

Temporarily inject cfg2 specific configs before boot.

Parameters:

platform_config (dict)

Return type:

None

tests.conftest.auto_platform_config_data(pytestconfig, cfg)[source]

Resolve and return the selected platform dictionary from the YAML config.

Parameters:
Returns:

Platform configuration dictionary.

Return type:

dict

tests.conftest.platform_bundle(pytestconfig, cfg, auto_platform_config_data)[source]

Build the platform bundle once from the config.

Parameters:
  • pytestconfig – Pytest configuration object.

  • cfg (test_automation.configs.config.Config) – Parsed configuration object.

  • auto_platform_config_data – Platform configuration dictionary.

Returns:

Yields an initialized DriverBundle.

tests.conftest.platform_driver(platform_bundle)[source]

Provide the platform driver object for tests.

Parameters:

platform_bundle – Initialized driver bundle.

Returns:

Driver instance from the bundle.

tests.conftest.session_manager(platform_bundle)[source]

Provide the session/console manager for tests.

Parameters:

platform_bundle – Initialized driver bundle.

Returns:

Session manager object.

tests.conftest.platform_name(platform_base_obj, cfg)[source]

Normalize the selected platform name to a canonical short name.

Parameters:
Returns:

Canonical name like 'aspne'.

Return type:

str

tests.conftest.platform_base_obj(session_manager, auto_platform_config_data, pytestconfig)[source]

Construct the base platform helper object once per session.

Parameters:
  • session_manager – Session/console manager instance.

  • auto_platform_config_data – Platform configuration dictionary.

  • pytestconfig – Pytest configuration object.

Returns:

Initialized AutoTestPlatformBase instance.

Return type:

test_automation.utils.auto_platform_base.AutoTestPlatformBase

tests.conftest.fpga_device(request)[source]

Session-scoped FPGA device fixture.

  • Initializes and starts the FPGA platform

  • Waits for ready state

  • Starts UART keepalive

  • Ensures graceful shutdown and log collection

tests.conftest.pytest_addoption(parser)[source]

Register custom CLI options used by the test framework.

Parameters:

parser – Pytest argument parser.

Returns:

None.

Return type:

None

tests.conftest._get_cfg2_si_cluster1_prompt()[source]

Return the expected prompt for si_cluster1 based on build type.

Return type:

str | None