File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
python/ql/test/experimental/dataflow/typetracking Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,22 @@ def test_create_with_foo():
4949 x = create_with_foo () # $ tracked=foo
5050 print (x .foo ) # $ tracked=foo tracked
5151
52+ def test_global_attribute_assignment ():
53+ global global_var
54+ global_var .foo = tracked # $ tracked tracked=foo
55+
56+ def test_global_attribute_read ():
57+ x = global_var .foo # $ MISSING: tracked tracked=foo
58+
59+ def test_local_attribute_assignment ():
60+ # Same as `test_global_attribute_assignment`, but the assigned variable is not global
61+ local_var = object () # $ tracked=foo
62+ local_var .foo = tracked # $ tracked tracked=foo
63+
64+ def test_local_attribute_read ():
65+ x = local_var .foo
66+
67+
5268# ------------------------------------------------------------------------------
5369# Attributes assigned statically to a class
5470# ------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments