File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed
04-area_of_right_triangle Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 11#Complete the function to return the area of the triangle.
2- b = input ("Size of B" )
3- h = input ("Size of H" )
4-
52def area_of_triangle (arg1 , arg2 ):
63 #your code here, please remove the "None"
74 return None
85
96# Testing your function
10- print (area_of_triangle (b , h ))
7+ print (area_of_triangle (4 , 5 ))
Original file line number Diff line number Diff line change @@ -10,13 +10,12 @@ def test_function_exists(capsys):
1010 except AttributeError :
1111 raise AttributeError ("The function 'area_of_triangle' should exist on app.py" )
1212
13- @pytest .mark .it ('The solution should return the expected output' )
13+ @pytest .mark .it ('The solution should return the expected output. Testing with 3 and 5 ' )
1414def test_convert_inputs (capsys , app ):
15- app .area_of_triangle (3 ,5 )
16- captured = capsys .readouterr ()
17- assert "7.5\n " == captured .out
18- # from app import area_of_triangle
19- # result = area_of_triangle(3,5)
20- # assert result == "7.5\n"
21-
15+ result = app .area_of_triangle (3 , 5 )
16+ assert result == 7.5
2217
18+ @pytest .mark .it ('The solution should return the expected output. Testing with 4 and 6' )
19+ def test_convert_inputs (capsys , app ):
20+ result = app .area_of_triangle (4 , 6 )
21+ assert result == 12
Original file line number Diff line number Diff line change @@ -3,7 +3,5 @@ def hello_name(name):
33
44 return None
55
6-
7-
86#Invoke the function with your name as the function's argument.
97print (hello_name ("Bob" ))
You can’t perform that action at this time.
0 commit comments