

def test_groupdisposable_remove():
    disp1 = [False]
    disp2 = [False]

    def action1():
        disp1[0] = True
    d1 = Disposable(action1)

    def action2():
        disp2[0] = True
    d2 = Disposable(action2)
    g = CompositeDisposable(d1, d2)
    assert (g.length == 2)
    assert g.contains(d1)
    assert g.contains(d2)
    assert g.remove(d1)
    assert (g.length == 1)
    assert (not g.contains(d1))
    assert g.contains(disp3)
    assert disp1[0]
    assert g.remove(d2)
    assert (not g.contains(d1))
    assert (not g.contains(d2))
    assert disp2[0]
    disp3 = [False]

    def action3():
        disp3[0] = True
    d3 = Disposable(action3)
    assert (not g.remove(d3))
    assert (not disp3[0])

dataset/ETHPy150Open ReactiveX/RxPY/tests/test_disposables/test_disposable.py test_groupdisposable_remove/VarMisuse@134/154 `d2`->`disp3`