get_device_proxy for Asyncio green_mode returns DeviceProxy instead of Future for AsyncDevices in TestContext
I notice, that get_device_proxy, when we request proxy with Asyncio green returns DeviceProxy instead of Future for AsyncDevices in TestContext:
from tango import GreenMode, get_device_proxy
from tango.server import Device
from tango.test_context import MultiDeviceTestContext
class TestDevice(Device):
pass
def test_get_device_proxy():
with MultiDeviceTestContext(config, process=False) as context:
fq_sync = context.get_device_access("test/device/1")
proxy = get_device_proxy(fq_sync, green_mode=GreenMode.Asyncio)
print(f"Proxy type is: {type(proxy)}")
output is as expected:
Ready to accept request
Proxy type is: <class '_asyncio.Future'>
But if the server is Async by itself:
from tango import GreenMode, get_device_proxy
from tango.server import Device
from tango.test_context import MultiDeviceTestContext
class TestDevice(Device):
green_mode = GreenMode.Asyncio
def test_get_device_proxy():
with MultiDeviceTestContext(config, process=False) as context:
fq_sync = context.get_device_access("test/device/1")
proxy = get_device_proxy(fq_sync, green_mode=GreenMode.Asyncio)
print(f"Proxy type is: {type(proxy)}")
we get DeviceProxy:
Ready to accept request
Proxy type is: <class 'tango._tango.DeviceProxy'>
Edited by Yury Matveyev