diff options
-rw-r--r-- | TODO.txt | 2 | ||||
-rw-r--r-- | coverage/__init__.py | 2 | ||||
-rw-r--r-- | coverage/control.py | 18 |
3 files changed, 10 insertions, 12 deletions
@@ -109,7 +109,7 @@ x Tricky swapping of collector like figleaf, pycov, et al. (Don't need to do + Use enumerate
+ Use sets instead of dicts
- Switch from getopt to optparse.
-- Get rid of the recursive nonsense.
++ Get rid of the recursive nonsense.
- Docstrings.
+ Remove huge document-style comments.
- Better names:
diff --git a/coverage/__init__.py b/coverage/__init__.py index d2311ce..82d76c2 100644 --- a/coverage/__init__.py +++ b/coverage/__init__.py @@ -31,7 +31,7 @@ def call_singleton_method(name, args, kwargs): return getattr(the_coverage, name)(*args, **kwargs) mod_funcs = """ - use_cache start stop erase begin_recursive end_recursive exclude + use_cache start stop erase exclude analysis analysis2 report annotate annotate_file """ diff --git a/coverage/control.py b/coverage/control.py index a6d2fa6..2ca4344 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -18,8 +18,6 @@ class coverage: self.parallel_mode = False self.exclude_re = '' self.nesting = 0 - self.cstack = [] - self.xstack = [] self.file_locator = FileLocator() self.collector = Collector(self.should_trace) @@ -78,18 +76,18 @@ class coverage: self.data.erase() def exclude(self, regex): + """Exclude source lines from execution consideration. + + `regex` is a regular expression. Lines matching this expressions are + not considered executable when reporting code coverage. A list of + regexes is maintained; this function adds a new regex to the list. + Matching any of the regexes excludes a source line. + + """ if self.exclude_re: self.exclude_re += "|" self.exclude_re += "(" + regex + ")" - def begin_recursive(self): - #self.cstack.append(self.c) - self.xstack.append(self.exclude_re) - - def end_recursive(self): - #self.c = self.cstack.pop() - self.exclude_re = self.xstack.pop() - def save(self): self.group_collected_data() self.data.write() |