Skip to content

Commit 899d675

Browse files
committed
Simplify the no-coverage marker.
1 parent d939125 commit 899d675

12 files changed

+25
-26
lines changed

.coveragerc

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ branch = true
33

44
[report]
55
show_missing = true
6-
exclude_lines =
7-
<no-coverage>
6+
exclude_lines = # no coverage
87

98
# vim:ft=dosini

lib/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import sys
22

3-
if sys.version_info < (2, 6): # <no-coverage>
3+
if sys.version_info < (2, 6): # no coverage
44
raise RuntimeError('Python >= 2.6 is required')
5-
if sys.version_info >= (3, 0): # <no-coverage>
5+
if sys.version_info >= (3, 0): # no coverage
66
raise RuntimeError('Python 2.X is required')
77

88
# vim:ts=4 sts=4 sw=4 et

lib/cli/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
try:
1717
import argparse
18-
except ImportError as ex: # <no-coverage>
18+
except ImportError as ex: # no coverage
1919
utils.enhance_import_error(ex, 'argparse', 'python-argparse', 'https://pypi.python.org/pypi/argparse')
2020
raise
2121

lib/cli/djvu2hocr.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def bbox(self):
9393
@property
9494
def text(self):
9595
if len(self._sexpr) != 6:
96-
raise TypeError('list of {0} (!= 6) elements'.format(len(self._sexpr))) # <no-coverage>
96+
raise TypeError('list of {0} (!= 6) elements'.format(len(self._sexpr))) # no coverage
9797
if not isinstance(self._sexpr[5], sexpr.StringExpression):
98-
raise TypeError('last element is not a string') # <no-coverage>
98+
raise TypeError('last element is not a string') # no coverage
9999
return unicode(self._sexpr[5].value, 'UTF-8', 'replace')
100100

101101
@property
@@ -111,7 +111,7 @@ def children(self):
111111
def n_children(self):
112112
n = len(self._sexpr) - 5
113113
if n <= 0:
114-
raise TypeError('list of {0} (< 6) elements'.format(len(self._sexpr))) # <no-coverage>
114+
raise TypeError('list of {0} (< 6) elements'.format(len(self._sexpr))) # no coverage
115115
return n
116116

117117
def __repr__(self):

lib/cli/ocrodjvu.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Saver(object):
4949

5050
@utils.not_overridden
5151
def save(self, document, pages, djvu_path, sed_file):
52-
raise NotImplementedError('Cannot save results in this format') # <no-coverage>
52+
raise NotImplementedError('Cannot save results in this format') # no coverage
5353

5454
class BundledSaver(Saver):
5555

lib/engines/common.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ class Engine(object):
2525
def __init__(self, *args, **kwargs):
2626
tpname = '{mod}.{tp}'.format(tp=type(self).__name__, mod=self.__module__)
2727
if args:
28-
raise ValueError('{tp}.__init__() takes no positional arguments'.format(tp=tpname)) # <no-coverage>
28+
raise ValueError('{tp}.__init__() takes no positional arguments'.format(tp=tpname)) # no coverage
2929
if not isinstance(self.name, str):
30-
raise TypeError('{tp}.name must be a string'.format(tp=tpname)) # <no-coverage>
30+
raise TypeError('{tp}.name must be a string'.format(tp=tpname)) # no coverage
3131
if not issubclass(self.image_format, image_io.ImageFormat):
32-
raise TypeError('{tp}.image_format must be an ImageFormat subclass'.format(tp=tpname)) # <no-coverage>
32+
raise TypeError('{tp}.image_format must be an ImageFormat subclass'.format(tp=tpname)) # no coverage
3333
for key, value in kwargs.iteritems():
3434
try:
3535
prop = getattr(type(self), key)

lib/html5_support.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def parse(stream):
1717
try:
1818
import html5lib
19-
except ImportError as ex: # <no-coverage>
19+
except ImportError as ex: # no coverage
2020
utils.enhance_import_error(ex, 'html5lib', 'python-html5lib', 'https://github.com/html5lib/html5lib-python')
2121
raise
2222
return html5lib.parse(stream,

lib/ipc.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
thread_safe = True
2323
try:
2424
import subprocess32 as subprocess
25-
except ImportError: # <no-coverage>
25+
except ImportError: # no coverage
2626
import subprocess
2727
if os.name == 'posix':
2828
thread_safe = False
@@ -46,12 +46,12 @@ def get_signal_names():
4646
try:
4747
if data['SIGABRT'] == data['SIGIOT']:
4848
del data['SIGIOT']
49-
except KeyError: # <no-coverage>
49+
except KeyError: # no coverage
5050
pass
5151
try:
5252
if data['SIGCHLD'] == data['SIGCLD']:
5353
del data['SIGCLD']
54-
except KeyError: # <no-coverage>
54+
except KeyError: # no coverage
5555
pass
5656
return dict((no, name) for name, no in data.iteritems())
5757

lib/text_zones.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from djvu.dllpath import set_dll_search_path
1717
except ImportError:
1818
pass
19-
else: # <no-coverage>
19+
else: # no coverage
2020
set_dll_search_path()
2121

2222
from . import utils
@@ -25,7 +25,7 @@
2525
from djvu import const
2626
from djvu import decode
2727
from djvu import sexpr
28-
except ImportError as ex: # <no-coverage>
28+
except ImportError as ex: # no coverage
2929
utils.enhance_import_error(ex, 'python-djvulibre', 'python-djvu', 'http://jwilk.net/software/python-djvulibre')
3030
raise
3131

lib/unicode_support.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def get_icu():
1717
try:
1818
import icu
19-
except ImportError: # <no-coverage>
19+
except ImportError: # no coverage
2020
utils.enhance_import_error(ex, 'PyICU', 'python-pyicu', 'https://pypi.python.org/pypi/PyICU/')
2121
else:
2222
return icu

lib/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ def get_cpu_count():
159159
try:
160160
import multiprocessing
161161
return multiprocessing.cpu_count()
162-
except (ImportError, NotImplementedError): # <no-coverage>
162+
except (ImportError, NotImplementedError): # no coverage
163163
pass
164-
try: # <no-coverage>
164+
try: # no coverage
165165
return os.sysconf('SC_NPROCESSORS_ONLN')
166-
except (ValueError, OSError, AttributeError): # <no-coverage>
166+
except (ValueError, OSError, AttributeError): # no coverage
167167
return 1
168168

169169
# vim:ts=4 sts=4 sw=4 et

lib/version.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,26 @@ def __call__(self, parser, namespace, values, option_string=None):
3636
print('+ subprocess32')
3737
try:
3838
djvu_decode = sys.modules['djvu.decode']
39-
except LookupError: # <no-coverage>
39+
except LookupError: # no coverage
4040
pass
4141
else:
4242
print('+ python-djvulibre {0}'.format(djvu_decode.__version__))
4343
try:
4444
lxml_etree = sys.modules['lxml.etree']
45-
except LookupError: # <no-coverage>
45+
except LookupError: # no coverage
4646
pass
4747
else:
4848
print('+ lxml {0}'.format(lxml_etree.__version__))
4949
try:
5050
import html5lib
51-
except ImportError: # <no-coverage>
51+
except ImportError: # no coverage
5252
pass
5353
else:
5454
print('+ html5lib-python {0}'.format(html5lib.__version__))
5555
try:
5656
from . import unicode_support
5757
pyicu = unicode_support.get_icu()
58-
except ImportError: # <no-coverage>
58+
except ImportError: # no coverage
5959
pass
6060
else:
6161
print('+ PyICU {0}'.format(pyicu.VERSION))

0 commit comments

Comments
 (0)