MCPcopy Create free account
hub / github.com/pallets/flask / test_app_freed_on_zero_refcount

Function test_app_freed_on_zero_refcount

tests/test_basic.py:1925–1937  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1923
1924@require_cpython_gc
1925def test_app_freed_on_zero_refcount():
1926 # A Flask instance should not create a reference cycle that prevents CPython
1927 # from freeing it when all external references to it are released (see #3761).
1928 gc.disable()
1929 try:
1930 app = flask.Flask(__name__)
1931 assert app.view_functions["static"]
1932 weak = weakref.ref(app)
1933 assert weak() is not None
1934 del app
1935 assert weak() is None
1936 finally:
1937 gc.enable()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected