Skip to content

Commit 012e473

Browse files
committed
completed.
1 parent f46351e commit 012e473

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

Efficiency and Testing/Pytest-Module1.py

+23
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,26 @@
1111
teardown_class() method to clean up after tests.
1212
"""
1313

14+
import sys
15+
16+
def doubleit(x):
17+
var = x * 2
18+
return var
19+
20+
if __name__ == "__main__":
21+
input_val = sys.argv[1]
22+
doubled_val = doubleit(input_val)
23+
24+
print(f"The value of {input_val} is {doubled_val}")
25+
26+
27+
import myprogram
28+
29+
def test_doubleit():
30+
assert myprogram.doubleit(10) == 20
31+
32+
33+
34+
35+
36+

Efficiency and Testing/myprogram.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import sys
2+
3+
def doubleit(x):
4+
var = x * 2
5+
return var
6+
7+
if __name__ == "__main__":
8+
input_val = sys.argv[1]
9+
doubled_val = doubleit(input_val)
10+
11+
print(f"The value of {input_val} is {doubled_val}")
12+

0 commit comments

Comments
 (0)