File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
exercises/01.4-Add-item-to-list Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 22
33@pytest .mark .it ("Import the random package" )
44def test_import_random ():
5+ path = os .path .dirname (os .path .abspath (__file__ ))+ '/app.py'
56 with open (path , 'r' ) as content_file :
67 content = content_file .read ()
78 regex = re .compile (r"import(\s)+random" )
89 assert bool (regex .search (content )) == True
910
1011@pytest .mark .it ("Use the for loop" )
1112def test_for_loop ():
13+ path = os .path .dirname (os .path .abspath (__file__ ))+ '/app.py'
1214 with open (path , 'r' ) as content_file :
1315 content = content_file .read ()
1416 regex = re .compile (r"for(\s)+(\w)+in(\s)+range" )
@@ -18,4 +20,4 @@ def test_for_loop():
1820def test_add ():
1921 f = open (os .path .dirname (os .path .abspath (__file__ )) + '/app.py' )
2022 content = f .read ()
21- assert content .find ("my_list.append(random.randint(1,100))" ) > 0
23+ assert content .find ("my_list.append(random.randint(1,100))" ) > 0
You can’t perform that action at this time.
0 commit comments