File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
python/ql/test/experimental/dataflow/typetracking Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,7 @@ def test_yield():
215215
216216# see https://docs.python.org/3.11/library/contextlib.html#contextlib.contextmanager
217217from contextlib import contextmanager
218+ import contextlib
218219
219220@contextmanager
220221def managed_resource ():
@@ -224,3 +225,12 @@ def managed_resource():
224225def test_context_manager ():
225226 with managed_resource () as x : # $ MISSING: tracked
226227 print (x ) # $ MISSING: tracked
228+
229+ @contextlib .contextmanager
230+ def managed_resource2 ():
231+ x = tracked # $ tracked
232+ yield x # $ tracked
233+
234+ def test_context_manager2 ():
235+ with managed_resource2 () as x : # $ MISSING: tracked
236+ print (x ) # $ MISSING: tracked
You can’t perform that action at this time.
0 commit comments