From patchwork Mon Nov 21 23:48:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3, of, 5, oldpy] tests: update sitecustomize to use uuid1() instead of randrange() From: Augie Fackler X-Patchwork-Id: 17674 Message-Id: <59ed48548b8d21484008.1479772085@arthedain.pit.corp.google.com> To: mercurial-devel@mercurial-scm.org Date: Mon, 21 Nov 2016 18:48:05 -0500 # HG changeset patch # User Augie Fackler # Date 1479768699 18000 # Mon Nov 21 17:51:39 2016 -0500 # Node ID 59ed48548b8d21484008d3c8a9617dd6dddf13f4 # Parent 90385d2c7d7b968c4e36398f33f22fe9b28ec05b tests: update sitecustomize to use uuid1() instead of randrange() The comments mention that uuid would be better, so let's go ahead and make good on an old idea. diff --git a/tests/sitecustomize.py b/tests/sitecustomize.py --- a/tests/sitecustomize.py +++ b/tests/sitecustomize.py @@ -4,11 +4,10 @@ import os if os.environ.get('COVERAGE_PROCESS_START'): try: import coverage - import random + import uuid - # uuid is better, but not available in Python 2.4. covpath = os.path.join(os.environ['COVERAGE_DIR'], - 'cov.%s' % random.randrange(0, 1000000000000)) + 'cov.%s' % uuid.uuid1()) cov = coverage.coverage(data_file=covpath, auto_data=True) cov._warn_no_data = False cov._warn_unimported_source = False