-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_run_python_file.py
More file actions
56 lines (47 loc) · 1.01 KB
/
Copy pathtest_run_python_file.py
File metadata and controls
56 lines (47 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from functions.run_python import run_python_file
def main() -> None:
print("Running calculator without arguments:")
print(
run_python_file(
"calculator",
"main.py",
)
)
print("\nRunning calculator with arguments:")
print(
run_python_file(
"calculator",
"main.py",
["3 + 5"],
)
)
print("\nRunning calculator tests:")
print(
run_python_file(
"calculator",
"tests.py",
)
)
print("\nAttempting outside-directory execution:")
print(
run_python_file(
"calculator",
"../main.py",
)
)
print("\nAttempting missing file:")
print(
run_python_file(
"calculator",
"nonexistent.py",
)
)
print("\nAttempting non-Python file:")
print(
run_python_file(
"calculator",
"lorem.txt",
)
)
if __name__ == "__main__":
main()