def test_ambiguities():
    signatures = [[A], [B], [A, B], [B, A], [A, C]]
    expected = set([((A, B), (B, A))])
    result = ambiguities(signatures)
    assert set(map(frozenset, expected)) == set(map(frozenset, result))

    signatures = [[A], [B], [A, B], [B, A], [A, C], [B, B]]
    expected = set()
    result = ambiguities(signatures)
    assert set(map(frozenset, expected)) == set(map(frozenset, result))
def test_ambiguities():
    signatures = [[A], [B], [A, B], [B, A], [A, C]]
    expected = set([((A, B), (B, A))])
    result = ambiguities(signatures)
    assert set(map(frozenset, expected)) == set(map(frozenset, result))

    signatures = [[A], [B], [A, B], [B, A], [A, C], [B, B]]
    expected = set()
    result = ambiguities(signatures)
    assert set(map(frozenset, expected)) == set(map(frozenset, result))
def test_vararg_dispatch_ambiguity_in_variadic():
    f = Dispatcher('f')

    @f.register(float, [object])
    def _1(a, b, *args):
        return 1

    @f.register(object, [float])
    def _2(a, b, *args):
        return 2

    assert ambiguities(f.funcs)
Example #4
0
def test_no_dispatch_ambiguities():
    for func in [into, compute_up, compute_down, drop, create_index]:
        assert not ambiguities(func.funcs)
Example #5
0
def test_no_infer_ambiguities():
    assert not ambiguities(dt.infer.funcs)
Example #6
0
def test_no_infer_ambiguities():
    assert not ambiguities(dt.infer.funcs)
Example #7
0
def test_no_execute_ambiguities(func):
    assert not ambiguities(func.funcs)
Example #8
0
def test_no_ambiguities():
    ambs = ambiguities(ibis_type_to_bigquery_type.funcs)
    assert not ambs
def test_no_ambiguities():
    ambs = ambiguities(ibis_type_to_cloud_spanner_type.funcs)
    assert not ambs
Example #10
0
def test_compute_one_non_ambiguous():
    assert not ambiguities(compute_one.funcs)
Example #11
0
def test_into_non_ambiguous():
    assert not ambiguities(into.funcs)
Example #12
0
def test_no_ambiguities():
    ambs = ambiguities(ibis_type_to_bigquery_type.funcs)
    assert not ambs