2.1.1. tests.conftest

2.1.1.1. Attributes

logger

2.1.1.2. Functions

pytest_configure(config)

Configure pytest logging and conditionally load target plugins.

cfg(pytestconfig)

Load the YAML configuration once per test session.

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.

pytest_addoption(parser)

Register custom CLI options used by the test framework.

2.1.1.3. Module Contents

tests.conftest.logger[source]
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.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.pytest_addoption(parser)[source]

Register custom CLI options used by the test framework.

Parameters:

parser – Pytest argument parser.

Returns:

None.

Return type:

None