@@ -17,10 +17,10 @@ func parsePyFile(t *testing.T, source string) *ParseResult {
1717func Test_PyBuildScopeTree (t * testing.T ) {
1818 t .Run ("is able to resolve references" , func (t * testing.T ) {
1919 source := `
20- x = 1
21- if True:
22- y = x
23- z = x`
20+ x = 1
21+ if True:
22+ y = x
23+ z = x`
2424 parsed := parsePyFile (t , source )
2525
2626 scopeTree := MakeScopeTree (parsed .Language , parsed .Ast , parsed .Source )
@@ -47,14 +47,14 @@ func Test_PyBuildScopeTree(t *testing.T) {
4747
4848 t .Run ("supports import statements" , func (t * testing.T ) {
4949 source := `
50- import os
50+ import os
5151
52- os.system("cat file.txt")
52+ os.system("cat file.txt")
5353
54- from csv import read
54+ from csv import read
5555
56- if True:
57- f = read(file.csv)
56+ if True:
57+ f = read(file.csv)
5858 `
5959 parsed := parsePyFile (t , source )
6060
@@ -96,10 +96,10 @@ func Test_PyBuildScopeTree(t *testing.T) {
9696
9797 t .Run ("supports function parameters" , func (t * testing.T ) {
9898 source := `
99- def myFunc(a, b=2, c:int, d:str="Hello"):
100- A = otherFunc(a)
101- C = b + c
102- print(d)
99+ def myFunc(a, b=2, c:int, d:str="Hello"):
100+ A = otherFunc(a)
101+ C = b + c
102+ print(d)
103103 `
104104 parsed := parsePyFile (t , source )
105105
@@ -144,8 +144,8 @@ func Test_PyBuildScopeTree(t *testing.T) {
144144
145145 t .Run ("supports with statements" , func (t * testing.T ) {
146146 source := `
147- with open("file.txt", 'r') as f:
148- print(f.read(5))
147+ with open("file.txt", 'r') as f:
148+ print(f.read(5))
149149 `
150150 parsed := parsePyFile (t , source )
151151
@@ -280,10 +280,10 @@ a = lambda x: x**2
280280
281281 t .Run ("supports exception statements" , func (t * testing.T ) {
282282 source := `
283- try:
284- result = 10 / 2
285- except ZeroDivisionError as e:
286- print(e)
283+ try:
284+ result = 10 / 2
285+ except ZeroDivisionError as e:
286+ print(e)
287287 `
288288 parsed := parsePyFile (t , source )
289289
0 commit comments