1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
# SPDX-FileCopyrightText: All Contributors to the PyTango project
# SPDX-License-Identifier: LGPL-3.0-or-later
"""
A module defining pytest fixtures for testing with MultiDeviceTestContext
Requires pytest, and at least PyTango 9.5.0
(see commit history for the approach to with earlier versions)
"""
from collections import defaultdict
import pytest
from tango.test_context import MultiDeviceTestContext
@pytest.fixture(scope="module")
def devices_info(request):
yield getattr(request.module, "devices_info")
@pytest.fixture(scope="function")
def tango_context(devices_info):
"""
Creates and returns a TANGO MultiDeviceTestContext object.
"""
with MultiDeviceTestContext(devices_info, process=True) as context:
yield context
|