diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-11-03 19:29:00 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-11-03 19:29:00 -0400 |
commit | 89d529895a21c40d1e3f3913b02540f32ab9a0b9 (patch) | |
tree | dde3b370d68a0049afb1715613ca8982e0d7a4ee /coverage | |
parent | e1331826649b26465f090ad9e3100ea0870aefc3 (diff) | |
download | python-coveragepy-git-89d529895a21c40d1e3f3913b02540f32ab9a0b9.tar.gz |
Debug-time environment variables can be set with set_env.py
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/data.py | 1 | ||||
-rw-r--r-- | coverage/misc.py | 1 | ||||
-rw-r--r-- | coverage/parser.py | 2 |
3 files changed, 4 insertions, 0 deletions
diff --git a/coverage/data.py b/coverage/data.py index 4a996e68..d6061293 100644 --- a/coverage/data.py +++ b/coverage/data.py @@ -640,6 +640,7 @@ class CoverageJsonData(object): return self._arcs is not None +# $set_env.py: COVERAGE_STORAGE - The storage implementation to use: sql (default), or json. STORAGE = os.environ.get("COVERAGE_STORAGE", "sql") if STORAGE == "json": CoverageData = CoverageJsonData diff --git a/coverage/misc.py b/coverage/misc.py index 1782d285..c484d61e 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -49,6 +49,7 @@ def dummy_decorator_with_args(*args_unused, **kwargs_unused): # Environment COVERAGE_NO_CONTRACTS=1 can turn off contracts while debugging # tests to remove noise from stack traces. +# $set_env.py: COVERAGE_NO_CONTRACTS - Disable PyContracts to simplify stack traces. USE_CONTRACTS = env.TESTING and not bool(int(os.environ.get("COVERAGE_NO_CONTRACTS", 0))) # Use PyContracts for assertion testing on parameters and returns, but only if diff --git a/coverage/parser.py b/coverage/parser.py index 6faa36e2..6ae81c19 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -491,6 +491,7 @@ new_contract('ArcStarts', lambda seq: all(isinstance(x, ArcStart) for x in seq)) # Turn on AST dumps with an environment variable. +# $set_env.py: COVERAGE_AST_DUMP - Dump the AST nodes when parsing code. AST_DUMP = bool(int(os.environ.get("COVERAGE_AST_DUMP", 0))) class NodeList(object): @@ -535,6 +536,7 @@ class AstArcAnalyzer(object): self.missing_arc_fragments = collections.defaultdict(list) self.block_stack = [] + # $set_env.py: COVERAGE_TRACK_ARCS - Trace every arc added while parsing code. self.debug = bool(int(os.environ.get("COVERAGE_TRACK_ARCS", 0))) def analyze(self): |