@pytest.fixture
async def ssdp_instant_discovery():
    'Instance discovery.'

    async def register_callback(hass, callback, match_dict):
        'Immediately do callback.'
        (await callback(TEST_DISCOVERY, ssdp.SsdpChange.ALIVE))
        return MagicMock()
    with patch('homeassistant.components.ssdp.async_register_callback', side_effect=register_callback) as mock_register, patch('homeassistant.components.ssdp.async_get_discovery_info_by_st', return_value=[TEST_DISCOVERY]) as mock_get_info:
        (yield (mock_register, mock_get_info))
Instance discovery.
@pytest.fixture
async def ssdp_instant_discovery():
    

    async def register_callback(hass, callback, match_dict):
        'Immediately do callback.'
        (await callback(TEST_DISCOVERY, ssdp.SsdpChange.ALIVE))
        return MagicMock()
    with patch('homeassistant.components.ssdp.async_register_callback', side_effect=register_callback) as mock_register, patch('homeassistant.components.ssdp.async_get_discovery_info_by_st', return_value=[TEST_DISCOVERY]) as mock_get_info:
        (yield (mock_register, mock_get_info))