Dear Pytest-Dev,

I am trying to implement a pytest plugin to check for reference leaks
similarly to how it is done in CPython with python -mtest -R : command.

The problem is that pytest_runtest_protocol seems to update some internal
state and calling it even on an empty test function increases the total
reference count.  Clearly, I need to clean up the internal state in my
plugin, but I cannot figure out where this state is kept.

Looking at the  pytest_runtest_protocol implementation in runner.py, I see
the following code:

def pytest_runtest_protocol(item, nextitem):
    ...
    runtestprotocol(item, nextitem=nextitem)
    return True

where runtestprotocol() is a function returning a list to reports, but this
list is apparently discarded by the runner.  Can someone explain how
reports are passed from the runner hooks to the terminal hooks?
_______________________________________________
pytest-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to