diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-09-01 21:34:20 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-09-01 21:34:20 -0400 |
commit | dd98bb1ebb687e4ff22e255ee97ec8e8cca5e1f6 (patch) | |
tree | 4b25e042b0827aac5c68e62d413a5d6e8e1a5fdd /coverage/config.py | |
parent | 4042ce713e373f19ca81948eefcfab83d8dd0bbc (diff) | |
download | python-coveragepy-git-dd98bb1ebb687e4ff22e255ee97ec8e8cca5e1f6.tar.gz |
Reporting methods shouldn't permanently change the configuration
Diffstat (limited to 'coverage/config.py')
-rw-r--r-- | coverage/config.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/coverage/config.py b/coverage/config.py index 516fe1b9..85493df1 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -4,6 +4,7 @@ """Config file for coverage.py""" import collections +import copy import os import re @@ -215,7 +216,7 @@ class CoverageConfig(object): self.xml_output = "coverage.xml" self.xml_package_depth = 99 - # Defaults for [JSON] + # Defaults for [json] self.json_output = "coverage.json" self.json_pretty_print = False self.json_show_contexts = False @@ -318,6 +319,10 @@ class CoverageConfig(object): return used + def copy(self): + """Return a copy of the configuration.""" + return copy.deepcopy(self) + CONFIG_FILE_OPTIONS = [ # These are *args for _set_attr_from_config_option: # (attr, where, type_="") |