Skip to content

Commit dcd448b

Browse files
committed
Python: Refactor formatting
1 parent 09de1bc commit dcd448b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python/ql/test/experimental/dataflow/typetracking/attribute_tests.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ def test_incompatible_types():
3030
x.field = str("Hello") # $str=field str SPURIOUS: int=field int
3131
expects_string(x) # $ str=field SPURIOUS: int=field
3232

33-
33+
# ------------------------------------------------------------------------------
3434
# Attributes assigned statically to a class
35+
# ------------------------------------------------------------------------------
3536

3637
class MyClass: # $tracked=field
3738
field = tracked # $tracked
@@ -40,7 +41,9 @@ class MyClass: # $tracked=field
4041
instance = MyClass() # $tracked=field
4142
lookup2 = instance.field # MISSING: tracked
4243

43-
## Dynamic attribute access
44+
# ------------------------------------------------------------------------------
45+
# Dynamic attribute access
46+
# ------------------------------------------------------------------------------
4447

4548
# Via `getattr`/`setattr`
4649

@@ -105,6 +108,7 @@ def dunder_dict_indirect_read():
105108

106109
# attribute set in method
107110
# inspired by https://github.com/github/codeql/pull/6023
111+
108112
class MyClass2(object):
109113
def __init__(self): # $ tracked=foo
110114
self.foo = tracked # $ tracked=foo tracked
@@ -121,6 +125,7 @@ def possibly_uncalled_method(self):
121125

122126

123127
# attribute set from outside of class
128+
124129
class MyClass3(object):
125130
def print_self(self): # $ tracked=foo
126131
print(self) # $ tracked=foo

0 commit comments

Comments
 (0)