[Tutor] Unit testing infinite loops

Steven D'Aprano steve at pearwood.info
Fri Jan 31 13:32:43 CET 2014


On Fri, Jan 31, 2014 at 01:10:03PM +0100, spir wrote:
> I don't know whether one can interrupt while sleeping

py> from time import sleep
py> sleep(60*60*24*365)  # 1 year
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyboardInterrupt

Yes you can.



-- 
Steven


More information about the Tutor mailing list