Ignore some lines for coverage.

pull/281/head
Bill Wendling 6 years ago
parent ca0929e645
commit 93885e491e
  1. 1
      .coveragerc
  2. 2
      yapf/yapflib/reformatter.py
  3. 4
      yapf/yapflib/unwrapped_line.py
  4. 4
      yapf/yapflib/yapf_api.py

@ -1,4 +1,5 @@
[report]
# Verifier is used for testing only.
omit =
*/__main__.py
*/verifier.py

@ -258,7 +258,7 @@ class _StateNode(object):
self.newline = newline
self.previous = previous
def __repr__(self):
def __repr__(self): # pragma: no cover
return 'StateNode(state=[\n{0}\n], newline={1})'.format(self.state,
self.newline)

@ -141,10 +141,10 @@ class UnwrappedLine(object):
tokens_str = ' '.join(tok.value for tok in self._tokens)
return indent + tokens_str
def __str__(self):
def __str__(self): # pragma: no cover
return self.AsCode()
def __repr__(self):
def __repr__(self): # pragma: no cover
tokens_repr = ','.join(['{0}({1!r})'.format(tok.name, tok.value)
for tok in self._tokens])
return 'UnwrappedLine(depth={0}, tokens=[{1}])'.format(self.depth,

@ -148,7 +148,7 @@ def FormatCode(unformatted_source,
return reformatted_source, True
def _CheckPythonVersion():
def _CheckPythonVersion(): # pragma: no cover
errmsg = 'yapf is only supported for Python 2.7 or 3.4+'
if sys.version_info[0] == 2:
if sys.version_info[1] < 7:
@ -189,7 +189,7 @@ def ReadFile(filename, logger=None):
encoding=encoding) as fd:
source = fd.read()
return source, encoding
except IOError as err:
except IOError as err: # pragma: no cover
if logger:
logger(err)
raise

Loading…
Cancel
Save