summaryrefslogtreecommitdiff
path: root/markdown/serializers.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2014-07-11 21:24:30 -0400
committerWaylan Limberg <waylan@gmail.com>2014-07-11 21:24:30 -0400
commit7d728afc3a684afadc7fa5c4672811ac0cc2fa98 (patch)
tree25e65c3520c2f7760d48a33ed7bc2322feb3cc59 /markdown/serializers.py
parentdf170411f369d20f85a4718698cdff100271b587 (diff)
downloadpython-markdown-7d728afc3a684afadc7fa5c4672811ac0cc2fa98.tar.gz
Marked a bunch of lines as 'no cover'. Coverage at 91%
Diffstat (limited to 'markdown/serializers.py')
-rw-r--r--markdown/serializers.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/markdown/serializers.py b/markdown/serializers.py
index aa82806..72fcef6 100644
--- a/markdown/serializers.py
+++ b/markdown/serializers.py
@@ -42,9 +42,9 @@ from __future__ import unicode_literals
from . import util
ElementTree = util.etree.ElementTree
QName = util.etree.QName
-if hasattr(util.etree, 'test_comment'):
+if hasattr(util.etree, 'test_comment'): #pragma: no cover
Comment = util.etree.test_comment
-else:
+else: #prgama: no cover
Comment = util.etree.Comment
PI = util.etree.PI
ProcessingInstruction = util.etree.ProcessingInstruction
@@ -56,7 +56,7 @@ HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr",
try:
HTML_EMPTY = set(HTML_EMPTY)
-except NameError:
+except NameError: #pragma: no cover
pass
_namespace_map = {
@@ -73,7 +73,7 @@ _namespace_map = {
}
-def _raise_serialization_error(text):
+def _raise_serialization_error(text): #pragma: no cover
raise TypeError(
"cannot serialize %r (type %s)" % (text, type(text).__name__)
)
@@ -81,7 +81,7 @@ def _raise_serialization_error(text):
def _encode(text, encoding):
try:
return text.encode(encoding, "xmlcharrefreplace")
- except (TypeError, AttributeError):
+ except (TypeError, AttributeError): #pragma: no cover
_raise_serialization_error(text)
def _escape_cdata(text):
@@ -97,7 +97,7 @@ def _escape_cdata(text):
if ">" in text:
text = text.replace(">", "&gt;")
return text
- except (TypeError, AttributeError):
+ except (TypeError, AttributeError): #pragma: no cover
_raise_serialization_error(text)
@@ -115,7 +115,7 @@ def _escape_attrib(text):
if "\n" in text:
text = text.replace("\n", "&#10;")
return text
- except (TypeError, AttributeError):
+ except (TypeError, AttributeError): #pragma: no cover
_raise_serialization_error(text)
def _escape_attrib_html(text):
@@ -130,7 +130,7 @@ def _escape_attrib_html(text):
if "\"" in text:
text = text.replace("\"", "&quot;")
return text
- except (TypeError, AttributeError):
+ except (TypeError, AttributeError): #pragma: no cover
_raise_serialization_error(text)
@@ -240,7 +240,7 @@ def _namespaces(elem, default_namespace=None):
"default_namespace option"
)
qnames[qname] = qname
- except TypeError:
+ except TypeError: #pragma: no cover
_raise_serialization_error(qname)
# populate qname and namespaces table