Exemple #1
0
def test_unpack_multiline(d):
    with unpack(d) as (
            a,
            b,
    ):
        assert a == 3
        assert b == 7
Exemple #2
0
def test_unpack_several_dicts(d, other):
    with unpack(d) as a, unpack(other) as (b, a):
        assert a == -3
        assert b == -7
    with unpack(d) as (a, b), unpack(other) as b:
        assert a == 3
        assert b == -7
    with unpack(d) as a, unpack(other) as c:
        assert a == 3
        assert c is True
Exemple #3
0
def test_unpack_several_dict_no_mix(d, other):
    with pytest.raises(KeyError):
        with unpack(d) as (a, c), unpack(other) as (a, c):
            pass
Exemple #4
0
def test_unpack_multi_single(d):
    with unpack(d) as (b, ):
        assert b == 7
Exemple #5
0
def test_unpack_multi(d):
    with unpack(d) as (a, b):
        assert a == 3
        assert b == 7
Exemple #6
0
def test_unpack_non_existent(d):
    with pytest.raises(KeyError):
        with unpack(d) as non_existent:
            pass
Exemple #7
0
def test_unpack_one(d):
    with unpack(d) as a:
        assert a == 3