Example #1
0
def reaper(request):
    config_fixture = request.getfixturevalue("config")
    reaper = Reaper(config_fixture)

    yield reaper

    with contextlib.suppress(Exception):
        if reaper.thread.is_alive() or not reaper.state.should_stop():
            reaper.state.set(State.OFFLINE)
            reaper.join(timeout=1)

    del reaper
    gc.collect()
def reaper(request):
    config_fixture = request.getfixturevalue("config")
    reaper = Reaper(config_fixture)

    yield reaper

    try:
        if reaper.thread.is_alive() or not reaper.state.should_stop():
            reaper.state.set(State.OFFLINE)
            reaper.join(timeout=1)
    except Exception:
        pass

    del reaper
    gc.collect()