コード例 #1
0
def test_delattr():
    n = OrderedMapping()
    with pytest.raises(AttributeError):
        del n.not_there
    n.there = 1
    del n.there
    assert not hasattr(n, 'there'), \
        'del should delete attribute'
コード例 #2
0
def test_delattr():
    n = OrderedMapping()
    with pytest.raises(AttributeError):
        del n.not_there
    n.there =1
    del n.there
    assert not hasattr(n, 'there'), \
        'del should delete attribute'
コード例 #3
0
ファイル: pkcollections_test.py プロジェクト: moellep/pykern
def test_delattr():
    from pykern.pkcollections import OrderedMapping

    n = OrderedMapping()
    with pytest.raises(AttributeError):
        del n.not_there
    n.there = 1
    del n.there
    assert not hasattr(n, 'there'), \
        'del should delete attribute'