def test_cache():
    fs = DummyTestFS()
    fs2 = DummyTestFS()
    assert (fs is fs2)
    assert (len(fs._cache) == 1)
    del fs2
    assert (len(fs._cache) == 1)
    del fs
    assert (len(DummyTestFS._cache) == 1)
    DummyTestFS.clear_instance_cache()
    assert (len(DummyTestFS._cache) == 0)
def test_cache():
    fs = DummyTestFS()
    fs2 = DummyTestFS()
    assert (fs is fs2)
    assert (len(fs._cache) == 1)
    del fs2
    assert (len(fs._cache) == 1)
    del fs
    assert (len(DummyTestFS._cache) == 1)
    DummyTestFS.clear_instance_cache()
    assert (len(DummyTestFS._cache) == 0)