check_support; Attribute()

This commit is contained in:
Yuyao Huang
2024-04-22 16:43:21 +08:00
parent 0281d68cb4
commit c620d0b014
11 changed files with 74 additions and 9 deletions
+12 -1
View File
@@ -13,6 +13,7 @@ def test_constant():
x = 2
print(x == 2)
"""
<callable> : print
True : x == 2
None : print(x == 2)
"""
@@ -64,7 +65,7 @@ def test_if():
def test_for():
with closing(StringIO()) as f:
@Commentor(f)
@Commentor(f, _exit=False, check=False)
def target():
odds = []
# return only odd numbers - 1,3,5,7,9
@@ -101,6 +102,8 @@ def test_for():
# continue # skipped
# odds.append(x)
"""
[] : odds
<callable> : odds.append
1 : x
None : odds.append(x)
"""
@@ -125,6 +128,8 @@ def test_for():
# continue # skipped
# odds.append(x)
"""
[1] : odds
<callable> : odds.append
3 : x
None : odds.append(x)
"""
@@ -149,6 +154,8 @@ def test_for():
# continue # skipped
# odds.append(x)
"""
[1, 3] : odds
<callable> : odds.append
5 : x
None : odds.append(x)
"""
@@ -173,6 +180,8 @@ def test_for():
# continue # skipped
# odds.append(x)
"""
[1, 3, 5] : odds
<callable> : odds.append
7 : x
None : odds.append(x)
"""
@@ -197,6 +206,8 @@ def test_for():
continue # skipped
odds.append(x)
"""
[1, 3, 5, 7] : odds
<callable> : odds.append
9 : x
None : odds.append(x)
"""
+1 -1
View File
@@ -17,7 +17,7 @@ def test_return():
with closing(StringIO()) as f:
@Commentor(f)
@Commentor(f, _exit=False)
def target():
a = 1
return a + 1
+1
View File
@@ -46,6 +46,7 @@ def test_call_print():
def target():
print('This line will be printed.')
"""
<callable> : print
None : print('This line will be printed.')
"""
''')
+1
View File
@@ -14,6 +14,7 @@ def test_assign():
myint = 7
print(myint)
"""
<callable> : print
7 : myint
None : print(myint)
"""