pytest_bluezenv.host_config#
- pytest_bluezenv.host_config(*host_setup, hw=False, mem=None, controller=True, reuse=False)[source]#
Declare host configuration.
- Parameters:
*host_setup – each argument is a list of plugins to be loaded on a host. The number of arguments specifies the number of hosts.
hw (bool) – whether to require hardware BT controller
mem (str) – amount of memory for the VM instances
controller (bool) – whether to add controller to the host
reuse (bool) – whether to define a setup where the test host processes are not required to be torn down between tests. This is only useful for tests that do not perturb e.g. bluetoothd state too much.
- Returns:
decorator setting pytest attributes
- Return type:
callable
Example
@host_config([Bluetoothd()], [Bluetoothd()]) def test_something(hosts): host0, host1 = hosts
Example
# Allow not restarting Bluetoothd between tests sharing this configuration base_config = host_config([Bluetoothd()], reuse=True) @base_config def test_one(hosts): host0, = hosts @base_config def test_two(hosts): # Note: uses same Bluetoothd() instance as above host0, = hosts