14
14
15
15
def _true ():
16
16
return True
17
+
18
+
17
19
def _false ():
18
20
return False
19
21
@@ -53,17 +55,20 @@ def test_back_and_forth():
53
55
assertEqual (db .fell , False )
54
56
assertEqual (db .rose , False )
55
57
time .sleep (0.02 )
56
- assert 0.019 < db .current_duration <= 1 , \
58
+ assert 0.019 < db .current_duration <= 1 , (
57
59
"Unit error? sleep .02 -> duration %d" % db .current_duration
60
+ )
58
61
db .update ()
59
62
assertEqual (db .value , False )
60
63
assertEqual (db .rose , False )
61
64
assertEqual (db .fell , True )
62
65
63
- assert 0 < db .current_duration <= 0.1 , \
66
+ assert 0 < db .current_duration <= 0.1 , (
64
67
"Unit error? time to run asserts %d" % db .current_duration
65
- assert 0 < db .last_duration < 0.1 , \
68
+ )
69
+ assert 0 < db .last_duration < 0.1 , (
66
70
"Unit error? Last dur should be ~.02, is %d" % db .last_duration
71
+ )
67
72
68
73
69
74
def test_interval_is_the_same ():
@@ -115,7 +120,7 @@ def run():
115
120
passes = 0
116
121
fails = 0
117
122
for name , test in locals ().items ():
118
- if name .startswith (' test_' ) and callable (test ):
123
+ if name .startswith (" test_" ) and callable (test ):
119
124
try :
120
125
print ()
121
126
print (name )
@@ -129,16 +134,18 @@ def run():
129
134
130
135
print (passes , "passed," , fails , "failed" )
131
136
if passes and not fails :
132
- print (r"""
137
+ print (
138
+ r"""
133
139
________
134
140
< YATTA! >
135
141
--------
136
142
\ ^__^
137
143
\ (oo)\_______
138
144
(__)\ )\/\
139
145
||----w |
140
- || ||""" )
146
+ || ||"""
147
+ )
141
148
142
149
143
- if __name__ == ' __main__' :
150
+ if __name__ == " __main__" :
144
151
run ()
0 commit comments