()
| 1923 | |
| 1924 | @require_cpython_gc |
| 1925 | def 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() |
nothing calls this directly
no outgoing calls
no test coverage detected