def test_nontoken_parallel_iter(source_iterables, target_iterable): with pytest.raises(SockeyeError) as e: list(data_io.parallel_iter(source_iterables, target_iterable)) assert str(e.value).startswith("Source sequences are not token-parallel")
def test_parallel_iter(source_iterables, target_iterable, expected): assert list(data_io.parallel_iter(source_iterables, target_iterable)) == expected
def test_nonparallel_iter(source_iterables, target_iterable): with pytest.raises(SockeyeError) as e: list(data_io.parallel_iter(source_iterables, target_iterable)) assert str( e.value ) == "Different number of lines in source(s) and target iterables."
def test_nonparallel_iter(source_iterables, target_iterable): with pytest.raises(SockeyeError) as e: list(data_io.parallel_iter(source_iterables, target_iterable)) assert str(e.value) == "Different number of lines in source(s) and target iterables."
def test_parallel_iter(source_iterables, target_iterables, expected): pytest.importorskip('mxnet') from sockeye import data_io assert list(data_io.parallel_iter(source_iterables, target_iterables)) == expected
def test_not_target_token_parallel_iter(source_iterables, target_iterables): pytest.importorskip('mxnet') from sockeye import data_io with pytest.raises(SockeyeError) as e: list(data_io.parallel_iter(source_iterables, target_iterables)) assert str(e.value).startswith("Target sequences are not token-parallel")
def test_nonparallel_iter(source_iterables, target_iterables): pytest.importorskip('mxnet') from sockeye import data_io with pytest.raises(SockeyeError) as e: list(data_io.parallel_iter(source_iterables, target_iterables)) assert str(e.value) == "Different number of lines in source(s) and target(s) iterables."