This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / testing / _private / utils / assert_no_gc_cycles

function

numpy.testing._private.utils:assert_no_gc_cycles

source: build-install/usr/lib/python3.14/site-packages/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