

def test_mutabledisposable_dispose():
    disp = [False]
    m = SerialDisposable()

    def action():
        disp[0] = True
    d = Disposable(action)
    m.disposable = d
    assert (d == m.disposable)
    assert (not disp[0])
    m.dispose()
    assert disp[0]
    assert (m.disposable == None)

dataset/ETHPy150Open ReactiveX/RxPY/tests/test_disposables/test_disposable.py test_mutabledisposable_dispose/original