-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtests.py
More file actions
39 lines (26 loc) · 751 Bytes
/
tests.py
File metadata and controls
39 lines (26 loc) · 751 Bytes
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
import time
import random
from decorators.basic import timing, print_with_color, easy_debugger, run_multiple_times, handle_exception, fix_random
@timing
def this_function_takes_time():
time.sleep(3)
@print_with_color('blue')
@easy_debugger
def this_function_does_something():
print('something')
@run_multiple_times(3)
def this_print_words(words):
print(words)
@handle_exception
def buggy_function():
raise FileExistsError('This file dosen\'t exist!')
@run_multiple_times(3)
@fix_random()
def print_random_number():
print(random.random())
if __name__ == "__main__":
print_random_number()
this_function_takes_time()
buggy_function()
this_function_does_something()
this_print_words('Yoav Love Halav')