Mark Dickinson <dicki...@gmail.com> added the comment:

> If this is about passing time, there should be better ways (than
> those which break if your computer gets faster).

Agreed.  The challenge is to find ways that don't add too much in the
way of extra complexity, fragility, or dependencies to the unit test.

How about replacing the xrange(100000000) loop with something like this,
which allows 30 seconds of real time and then fails with a timeout 
message:

start_time = time.time()
while time.time() - start_time < 5.0:
    <use some process time here>
    if signal.getitimer(self.itimer) == (0.0, 0.0):
        break
else:
    self.fail('timeout waiting for virtual timer signal')

----------
assignee:  -> mark.dickinson

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7042>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to