1414
1515def _true ():
1616 return True
17+
18+
1719def _false ():
1820 return False
1921
@@ -53,17 +55,20 @@ def test_back_and_forth():
5355 assertEqual (db .fell , False )
5456 assertEqual (db .rose , False )
5557 time .sleep (0.02 )
56- assert 0.019 < db .current_duration <= 1 , \
58+ assert 0.019 < db .current_duration <= 1 , (
5759 "Unit error? sleep .02 -> duration %d" % db .current_duration
60+ )
5861 db .update ()
5962 assertEqual (db .value , False )
6063 assertEqual (db .rose , False )
6164 assertEqual (db .fell , True )
6265
63- assert 0 < db .current_duration <= 0.1 , \
66+ assert 0 < db .current_duration <= 0.1 , (
6467 "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 , (
6670 "Unit error? Last dur should be ~.02, is %d" % db .last_duration
71+ )
6772
6873
6974def test_interval_is_the_same ():
@@ -115,7 +120,7 @@ def run():
115120 passes = 0
116121 fails = 0
117122 for name , test in locals ().items ():
118- if name .startswith (' test_' ) and callable (test ):
123+ if name .startswith (" test_" ) and callable (test ):
119124 try :
120125 print ()
121126 print (name )
@@ -129,16 +134,18 @@ def run():
129134
130135 print (passes , "passed," , fails , "failed" )
131136 if passes and not fails :
132- print (r"""
137+ print (
138+ r"""
133139 ________
134140< YATTA! >
135141 --------
136142 \ ^__^
137143 \ (oo)\_______
138144 (__)\ )\/\
139145 ||----w |
140- || ||""" )
146+ || ||"""
147+ )
141148
142149
143- if __name__ == ' __main__' :
150+ if __name__ == " __main__" :
144151 run ()
0 commit comments