Skip to content

Commit

Permalink
Windows Python 3.6 doesn't seed well. Hack around it.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Dec 27, 2016
1 parent 50fe58d commit 7bb4266
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions coverage/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import random
import re
import socket
import time

from coverage import env
from coverage.backward import iitems, string_class
Expand Down Expand Up @@ -665,6 +666,8 @@ def write(self, data, suffix=None):
with open(_TEST_NAME_FILE) as f:
test_name = f.read()
extra = "." + test_name
if env.WINDOWS:
time.sleep(0.001) # Yuk: http://bugs.python.org/issue29085
dice = random.Random().randint(0, 999999)
suffix = "%s%s.%s.%06d" % (socket.gethostname(), extra, os.getpid(), dice)

Expand Down

0 comments on commit 7bb4266

Please sign in to comment.