annotate tests/sitecustomize.py @ 50329:3dbc7b1ecaba stable

typing: correct the signature of error.CommandError There's a place in `mercurial.dispatch._parse()` that passes None if a parse error happens before the command can be parsed out, and casting the error to bytes works fine because the command and message fields are apparently ignored. Likewise, TortoiseHg similarly passes None for the same reason.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 24 Mar 2023 02:22:12 -0400
parents 6000f5b25c9b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24505
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
1 import os
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
2
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
3 if os.environ.get('COVERAGE_PROCESS_START'):
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
4 try:
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
5 import coverage
30477
d2c40510104e tests: update sitecustomize to use uuid1() instead of randrange()
Augie Fackler <augie@google.com>
parents: 28946
diff changeset
6 import uuid
24505
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
7
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 30477
diff changeset
8 covpath = os.path.join(
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 30477
diff changeset
9 os.environ['COVERAGE_DIR'], 'cov.%s' % uuid.uuid1()
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 30477
diff changeset
10 )
24505
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
11 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
12 cov._warn_no_data = False
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
13 cov._warn_unimported_source = False
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
14 cov.start()
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
15 except ImportError:
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
16 pass