|
3 | 3 | import copy |
4 | 4 | import pytest |
5 | 5 | from yggdrasil import platform |
6 | | -from yggdrasil.communication import new_comm, get_comm |
| 6 | +from yggdrasil.communication import new_comm, get_comm, AddressError |
7 | 7 | from yggdrasil.tools import get_supported_comm |
8 | 8 | from tests import TestComponentBase |
9 | 9 |
|
@@ -78,6 +78,7 @@ def get_send_comm_kwargs(self, commtype, use_async, |
78 | 78 | kws = dict(commtype=commtype, reverse_names=True, |
79 | 79 | direction='send', use_async=use_async) |
80 | 80 | kws.update(testing_options['kwargs']) |
| 81 | + kws.update(testing_options.get('send_kwargs', {})) |
81 | 82 | kws.update(kwargs) |
82 | 83 | return kws |
83 | 84 |
|
@@ -176,7 +177,14 @@ def wrapped_do_send_recv(send_comm, recv_comm, message=None, |
176 | 177 | recv_comm, recv_params.get('method', 'recv'))( |
177 | 178 | **recv_params.get('kwargs', {'timeout': 0})) |
178 | 179 | assert flag == recv_params.get('flag', True) |
179 | | - assert nested_approx(recv_params['message']) == msg |
| 180 | + try: |
| 181 | + assert nested_approx(recv_params['message']) == msg |
| 182 | + except BaseException: |
| 183 | + print("EXPECTED:") |
| 184 | + print(recv_params['message']) |
| 185 | + print("ACTUAL:") |
| 186 | + print(msg) |
| 187 | + raise |
180 | 188 | if not send_params.get('skip_wait', False): |
181 | 189 | wait_on_function( |
182 | 190 | lambda: send_comm.is_closed or (send_comm.n_msg_send == 0)) |
@@ -354,7 +362,7 @@ def test_empty_obj_recv(self, run_once, global_comm): |
354 | 362 |
|
355 | 363 | def test_error_name(self, python_class): |
356 | 364 | r"""Test error on missing address.""" |
357 | | - with pytest.raises(RuntimeError): |
| 365 | + with pytest.raises(AddressError): |
358 | 366 | python_class('test%s' % uuid.uuid4()) |
359 | 367 |
|
360 | 368 | def test_error_send(self, monkeypatch, send_comm, testing_options, |
|
0 commit comments