def test_close_clean(tmpdir):
    """
    On InotifyBuffer.close() InotifyBuffer.read_event() is un-blocked so that
    Inotify thread waiting for it can be closed.

    This is also a test for Inotify.queue_events handling of STOP_EVENT and
    InotifyBuffer.close() is test as side effect of Inotify.stop()
    """
    watch = ObservedWatch(path=tmpdir, recursive=False)
    emitter = InotifyEmitter([], watch)
    emitter.start()

    emitter.stop()
    emitter.join(1)
    assert not emitter.isAlive()
示例#2
0
def test_close_clean(tmpdir):
    """
    On InotifyBuffer.close() InotifyBuffer.read_event() is un-blocked so that
    Inotify thread waiting for it can be closed.

    This is also a test for Inotify.queue_events handling of STOP_EVENT and
    InotifyBuffer.close() is test as side effect of Inotify.stop()
    """
    watch = ObservedWatch(path=tmpdir, recursive=False)
    emitter = InotifyEmitter([], watch)
    emitter.start()

    emitter.stop()
    emitter.join(1)
    assert not emitter.isAlive()