Beispiel #1
0
def test_del3():
    d = ScalarDistribution([1 / 2, 1 / 2])
    with pytest.raises(InvalidOutcome):
        d.__delitem__(2)
Beispiel #2
0
def test_setitem2():
    pmf = [1 / 2, 1 / 2]
    d = ScalarDistribution(pmf)
    with pytest.raises(InvalidOutcome):
        d.__setitem__(2, 1 / 2)
Beispiel #3
0
def test_del2():
    d = ScalarDistribution([1 / 2, 1 / 2])
    d.make_dense()
    del d[1]
    d.normalize()
    assert d[0] == pytest.approx(1)