Skip to content

Resolve "CI: skip resource check fixtures when tests fail"

Closes #3873 (closed)

Do not raise exception in some cleanup fixtures when test fail (but still do the cleanup).

For example

import gevent

def test_aaa():
    g = gevent.spawn(gevent.sleep, 100)
    assert False

This used to give

FAILED tests/test_tmp.py::test_aaa - assert False
ERROR tests/test_tmp.py::test_aaa - RuntimeError: Not all greenlets were released

-------------------- Captured stderr teardown -------------------------
Resource not released: <BlissGreenlet at 0x7f6567b9acc0: sleep(100)>

After this MR it gives

FAILED tests/test_tmp.py::test_aaa - assert False

-------------------- Captured stderr teardown -------------------------
Resource not released: <BlissGreenlet at 0x7f6567b9acc0: sleep(100)>
Not all greenlets were released

This way we get ride of the traceback from the ERROR which is not the most important when the test fails.

Edited by Wout De Nolf

Merge request reports