You are viewing an older version (2.4.3). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / testing / _private / utils / assert_no_gc_cycles

function

numpy.testing._private.utils:assert_no_gc_cycles

source: /numpy/testing/_private/utils.py :2621

Signature

def   assert_no_gc_cycles ( * args ** kwargs )

Summary

Fail if the given callable produces any reference cycles.

Extended Summary

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

with assert_no_gc_cycles():
    do_something()

Parameters

func : callable

The callable to test.

\*args : Arguments

Arguments passed to func.

\*\*kwargs : Kwargs

Keyword arguments passed to func.

Returns

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

Aliases

  • numpy.testing.assert_no_gc_cycles