11import io , sys , pytest , os , re , mock
22
3- @pytest .mark .it ("Create a function 'calculate_area'" )
3+ @pytest .mark .it ("Create the function 'calculate_area'" )
44def test_declare_variable ():
55 path = os .path .dirname (os .path .abspath (__file__ ))+ '/app.py'
66 with open (path , 'r' ) as content_file :
@@ -16,7 +16,7 @@ def test_for_callable(capsys, app):
1616def test_for_integer (capsys , app ):
1717 assert isinstance (app .calculate_area (3 ,4 ), int )
1818
19- @pytest .mark .it ('We tried the function sum with a =3 and b =4 and it did not return 7 ' )
19+ @pytest .mark .it ('We tried the function sum with length =3 and width =4 and it did not return 12 ' )
2020def test_for_return (capsys , app ):
2121 assert app .calculate_area (3 ,4 ) == 12
2222 assert app .calculate_area (5 ,4 ) == 20
@@ -43,10 +43,10 @@ def test_for_square_area_value2(capsys, app):
4343def test_for_square_area_value3 (capsys , app ):
4444 assert app .square_area3 == 25
4545
46- @pytest .mark .it ("Create a function calculate_area must be called 3 times, one for each figure " )
46+ @pytest .mark .it ("The function calculate_area must be called 3 times, one for each square " )
4747def test_call_calculate_area ():
4848 path = os .path .dirname (os .path .abspath (__file__ ))+ '/app.py'
4949 with open (path , 'r' ) as content_file :
5050 content = content_file .read ()
5151 regex = re .compile (r"=(\s*)calculate_area\s*\(" )
52- assert bool (regex .search (content )) == True
52+ assert bool (regex .search (content )) == True
0 commit comments