summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-09-28 21:50:46 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-09-28 21:50:46 -0400
commit4b61c85875c2927bb13efbfaed277f59e61c068c (patch)
tree53b60f3c381d38571acea8b9dcad54e901d5868c
parent9453fa062539ac28b60c325e39c0fcbfd3b2ea10 (diff)
downloadpython-coveragepy-git-4b61c85875c2927bb13efbfaed277f59e61c068c.tar.gz
A few more metacov clean ups
-rw-r--r--coverage/parser.py4
-rw-r--r--tests/test_oddball.py2
-rw-r--r--tests/try_execfile.py7
3 files changed, 4 insertions, 9 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index c5e95baa..e7b9c029 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -413,7 +413,7 @@ class ByteParser(object):
for _, l in bp._bytes_lines():
yield l
- def _block_stack_repr(self, block_stack):
+ def _block_stack_repr(self, block_stack): # pragma: debugging
"""Get a string version of `block_stack`, for debugging."""
blocks = ", ".join(
"(%s, %r)" % (dis.opname[b[0]], b[1]) for b in block_stack
@@ -552,7 +552,7 @@ class ByteParser(object):
#self.validate_chunks(chunks)
return chunks
- def validate_chunks(self, chunks):
+ def validate_chunks(self, chunks): # pragma: debugging
"""Validate the rule that chunks have a single entrance."""
# starts is the entrances to the chunks
starts = set(ch.byte for ch in chunks)
diff --git a/tests/test_oddball.py b/tests/test_oddball.py
index 47f492f6..3a013b04 100644
--- a/tests/test_oddball.py
+++ b/tests/test_oddball.py
@@ -173,7 +173,7 @@ class MemoryLeakTest(CoverageTest):
if ram_growth > 100000:
fails += 1
- if fails > 8:
+ if fails > 8: # pragma: only failure
self.fail("RAM grew by %d" % (ram_growth))
diff --git a/tests/try_execfile.py b/tests/try_execfile.py
index 9bbabd1a..825fdb70 100644
--- a/tests/try_execfile.py
+++ b/tests/try_execfile.py
@@ -12,18 +12,13 @@ def my_function(a):
FN_VAL = my_function("fooey")
-try:
- pkg = __package__
-except NameError:
- pkg = "*No __package__*"
-
globals_to_check = {
'__name__': __name__,
'__file__': __file__,
'__doc__': __doc__,
'__builtins__.has_open': hasattr(__builtins__, 'open'),
'__builtins__.dir': dir(__builtins__),
- '__package__': pkg,
+ '__package__': __package__,
'DATA': DATA,
'FN_VAL': FN_VAL,
'__main__.DATA': getattr(__main__, "DATA", "nothing"),