Skip to content

Commit df75263

Browse files
Modifying the test and exercise in order to work without input
1 parent ca7e540 commit df75263

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#Complete the function to return the area of the triangle.
2-
b = input("Size of B")
3-
h = input("Size of H")
4-
52
def 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))

exercises/04-area_of_right_triangle/test.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff 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')
1414
def 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

exercises/05-hello_harry/app.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff 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.
97
print(hello_name("Bob"))

0 commit comments

Comments
 (0)