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():
49
49
x = create_with_foo () # $ tracked=foo
50
50
print (x .foo ) # $ tracked=foo tracked
51
51
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
+
52
68
# ------------------------------------------------------------------------------
53
69
# Attributes assigned statically to a class
54
70
# ------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments