Exemplo n.º 1
0
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")
Exemplo n.º 2
0
def test_parallel_iter(source_iterables, target_iterable, expected):
    assert list(data_io.parallel_iter(source_iterables,
                                      target_iterable)) == expected
Exemplo n.º 3
0
def test_parallel_iter(source_iterables, target_iterable, expected):
    assert list(data_io.parallel_iter(source_iterables, target_iterable)) == expected
Exemplo n.º 4
0
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."
Exemplo n.º 5
0
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")
Exemplo n.º 6
0
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."
Exemplo n.º 7
0
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
Exemplo n.º 8
0
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")
Exemplo n.º 9
0
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."