Mercurial > hg
annotate tests/sitecustomize.py @ 44856:b7808443ed6a
mergestate: split out merge state handling code from main merge module
There's already some pretty reasonable encapsulation here, but I want
to make the mergestate storage a property of the context so memctx
instances can do a reasonable thing. This is the first step in a
reshuffle to make that easier.
Differential Revision: https://phab.mercurial-scm.org/D8550
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 18 May 2020 14:59:59 -0400 |
parents | 2372284d9457 |
children | 6000f5b25c9b |
rev | line source |
---|---|
28946
b12bda49c3e3
py3: use absolute_import in sitecustomize.py
Robert Stanca <robert.stanca7@gmail.com>
parents:
24505
diff
changeset
|
1 from __future__ import absolute_import |
24505
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
2 import os |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
3 |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
4 if os.environ.get('COVERAGE_PROCESS_START'): |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
5 try: |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
6 import coverage |
30477
d2c40510104e
tests: update sitecustomize to use uuid1() instead of randrange()
Augie Fackler <augie@google.com>
parents:
28946
diff
changeset
|
7 import uuid |
24505
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
8 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
30477
diff
changeset
|
9 covpath = os.path.join( |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
30477
diff
changeset
|
10 os.environ['COVERAGE_DIR'], 'cov.%s' % uuid.uuid1() |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
30477
diff
changeset
|
11 ) |
24505
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
12 cov = coverage.coverage(data_file=covpath, auto_data=True) |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
13 cov._warn_no_data = False |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
14 cov._warn_unimported_source = False |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
15 cov.start() |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
16 except ImportError: |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
17 pass |