numpy.testing.assert_no_gc_cycles#

testing.assert_no_gc_cycles(*args,**kwargs)[source]#

Fail if the given callable produces any reference cycles.

If called with all arguments omitted, may be used as a context manager:

withassert_no_gc_cycles():do_something()
Parameters:
funccallable

The callable to test.

*argsArguments

Arguments passed tofunc.

**kwargsKwargs

Keyword arguments passed tofunc.

Returns:
Nothing. The result is deliberately discarded to ensure that all cycles
are found.