From ec68d8b8e4a9fc24e45379359f96b3ebc30e381a Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sun, 27 Mar 2016 12:02:41 +0200 Subject: [PATCH] s/nocover/no cover/g according to coveralls docs --- mitmproxy/script/script.py | 2 +- netlib/http/authentication.py | 2 +- netlib/http/headers.py | 6 +++--- netlib/http/message.py | 6 +++--- netlib/http/request.py | 28 ++++++++++++++-------------- netlib/http/response.py | 8 ++++---- pathod/pathoc.py | 4 ++-- pathod/pathoc_cmdline.py | 2 +- pathod/pathod.py | 2 +- pathod/pathod_cmdline.py | 2 +- pathod/utils.py | 2 +- setup.cfg | 1 - 12 files changed, 32 insertions(+), 33 deletions(-) diff --git a/mitmproxy/script/script.py b/mitmproxy/script/script.py index f142daca1..5a8334c46 100644 --- a/mitmproxy/script/script.py +++ b/mitmproxy/script/script.py @@ -47,7 +47,7 @@ class Script(object): if os.name == "nt": # pragma: no cover backslashes = shlex.split(command, posix=False)[0].count("\\") command = command.replace("\\", "\\\\", backslashes) - args = shlex.split(command) # pragma: nocover + args = shlex.split(command) # pragma: no cover args[0] = os.path.expanduser(args[0]) if not os.path.exists(args[0]): raise ScriptException( diff --git a/netlib/http/authentication.py b/netlib/http/authentication.py index d769abe54..6db70fdd2 100644 --- a/netlib/http/authentication.py +++ b/netlib/http/authentication.py @@ -140,7 +140,7 @@ class AuthAction(Action): authenticator = BasicProxyAuth(passman, "mitmproxy") setattr(namespace, self.dest, authenticator) - def getPasswordManager(self, s): # pragma: nocover + def getPasswordManager(self, s): # pragma: no cover raise NotImplementedError() diff --git a/netlib/http/headers.py b/netlib/http/headers.py index 784047964..9b8fdae4a 100644 --- a/netlib/http/headers.py +++ b/netlib/http/headers.py @@ -8,7 +8,7 @@ from __future__ import absolute_import, print_function, division import copy try: from collections.abc import MutableMapping -except ImportError: # pragma: nocover +except ImportError: # pragma: no cover from collections import MutableMapping # Workaround for Python < 3.3 @@ -16,7 +16,7 @@ import six from netlib.utils import always_byte_args, always_bytes, Serializable -if six.PY2: # pragma: nocover +if six.PY2: # pragma: no cover _native = lambda x: x _always_bytes = lambda x: x _always_byte_args = lambda x: x @@ -106,7 +106,7 @@ class Headers(MutableMapping, Serializable): else: return b"" - if six.PY2: # pragma: nocover + if six.PY2: # pragma: no cover __str__ = __bytes__ @_always_byte_args diff --git a/netlib/http/message.py b/netlib/http/message.py index 1df0f087f..b6d846baa 100644 --- a/netlib/http/message.py +++ b/netlib/http/message.py @@ -7,7 +7,7 @@ import six from .headers import Headers from .. import encoding, utils -if six.PY2: # pragma: nocover +if six.PY2: # pragma: no cover _native = lambda x: x _always_bytes = lambda x: x else: @@ -180,12 +180,12 @@ class Message(utils.Serializable): # Legacy @property - def body(self): # pragma: nocover + def body(self): # pragma: no cover warnings.warn(".body is deprecated, use .content instead.", DeprecationWarning) return self.content @body.setter - def body(self, body): # pragma: nocover + def body(self, body): # pragma: no cover warnings.warn(".body is deprecated, use .content instead.", DeprecationWarning) self.content = body diff --git a/netlib/http/request.py b/netlib/http/request.py index 1a9b6f18f..d35c1874e 100644 --- a/netlib/http/request.py +++ b/netlib/http/request.py @@ -100,7 +100,7 @@ class Request(Message): Setting the host attribute also updates the host header, if present. """ - if six.PY2: # pragma: nocover + if six.PY2: # pragma: no cover return self.data.host if not self.data.host: @@ -324,59 +324,59 @@ class Request(Message): # Legacy - def get_cookies(self): # pragma: nocover + def get_cookies(self): # pragma: no cover warnings.warn(".get_cookies is deprecated, use .cookies instead.", DeprecationWarning) return self.cookies - def set_cookies(self, odict): # pragma: nocover + def set_cookies(self, odict): # pragma: no cover warnings.warn(".set_cookies is deprecated, use .cookies instead.", DeprecationWarning) self.cookies = odict - def get_query(self): # pragma: nocover + def get_query(self): # pragma: no cover warnings.warn(".get_query is deprecated, use .query instead.", DeprecationWarning) return self.query or ODict([]) - def set_query(self, odict): # pragma: nocover + def set_query(self, odict): # pragma: no cover warnings.warn(".set_query is deprecated, use .query instead.", DeprecationWarning) self.query = odict - def get_path_components(self): # pragma: nocover + def get_path_components(self): # pragma: no cover warnings.warn(".get_path_components is deprecated, use .path_components instead.", DeprecationWarning) return self.path_components - def set_path_components(self, lst): # pragma: nocover + def set_path_components(self, lst): # pragma: no cover warnings.warn(".set_path_components is deprecated, use .path_components instead.", DeprecationWarning) self.path_components = lst - def get_form_urlencoded(self): # pragma: nocover + def get_form_urlencoded(self): # pragma: no cover warnings.warn(".get_form_urlencoded is deprecated, use .urlencoded_form instead.", DeprecationWarning) return self.urlencoded_form or ODict([]) - def set_form_urlencoded(self, odict): # pragma: nocover + def set_form_urlencoded(self, odict): # pragma: no cover warnings.warn(".set_form_urlencoded is deprecated, use .urlencoded_form instead.", DeprecationWarning) self.urlencoded_form = odict - def get_form_multipart(self): # pragma: nocover + def get_form_multipart(self): # pragma: no cover warnings.warn(".get_form_multipart is deprecated, use .multipart_form instead.", DeprecationWarning) return self.multipart_form or ODict([]) @property - def form_in(self): # pragma: nocover + def form_in(self): # pragma: no cover warnings.warn(".form_in is deprecated, use .first_line_format instead.", DeprecationWarning) return self.first_line_format @form_in.setter - def form_in(self, form_in): # pragma: nocover + def form_in(self, form_in): # pragma: no cover warnings.warn(".form_in is deprecated, use .first_line_format instead.", DeprecationWarning) self.first_line_format = form_in @property - def form_out(self): # pragma: nocover + def form_out(self): # pragma: no cover warnings.warn(".form_out is deprecated, use .first_line_format instead.", DeprecationWarning) return self.first_line_format @form_out.setter - def form_out(self, form_out): # pragma: nocover + def form_out(self, form_out): # pragma: no cover warnings.warn(".form_out is deprecated, use .first_line_format instead.", DeprecationWarning) self.first_line_format = form_out diff --git a/netlib/http/response.py b/netlib/http/response.py index 8f4d62158..da2c81421 100644 --- a/netlib/http/response.py +++ b/netlib/http/response.py @@ -97,20 +97,20 @@ class Response(Message): # Legacy - def get_cookies(self): # pragma: nocover + def get_cookies(self): # pragma: no cover warnings.warn(".get_cookies is deprecated, use .cookies instead.", DeprecationWarning) return self.cookies - def set_cookies(self, odict): # pragma: nocover + def set_cookies(self, odict): # pragma: no cover warnings.warn(".set_cookies is deprecated, use .cookies instead.", DeprecationWarning) self.cookies = odict @property - def msg(self): # pragma: nocover + def msg(self): # pragma: no cover warnings.warn(".msg is deprecated, use .reason instead.", DeprecationWarning) return self.reason @msg.setter - def msg(self, reason): # pragma: nocover + def msg(self, reason): # pragma: no cover warnings.warn(".msg is deprecated, use .reason instead.", DeprecationWarning) self.reason = reason diff --git a/pathod/pathoc.py b/pathod/pathoc.py index 86661f98e..0e6d3ca74 100644 --- a/pathod/pathoc.py +++ b/pathod/pathoc.py @@ -208,7 +208,7 @@ class Pathoc(tcp.TCPClient): self.ws_framereader = None if self.use_http2: - if not tcp.HAS_ALPN: # pragma: nocover + if not tcp.HAS_ALPN: # pragma: no cover log.write_raw( self.fp, "HTTP/2 requires ALPN support. " @@ -458,7 +458,7 @@ class Pathoc(tcp.TCPClient): # TODO: do something -def main(args): # pragma: nocover +def main(args): # pragma: no cover memo = set([]) trycount = 0 p = None diff --git a/pathod/pathoc_cmdline.py b/pathod/pathoc_cmdline.py index bf827a9aa..b59704f3a 100644 --- a/pathod/pathoc_cmdline.py +++ b/pathod/pathoc_cmdline.py @@ -221,6 +221,6 @@ def args_pathoc(argv, stdout=sys.stdout, stderr=sys.stderr): return args -def go_pathoc(): # pragma: nocover +def go_pathoc(): # pragma: no cover args = args_pathoc(sys.argv) pathoc.main(args) diff --git a/pathod/pathod.py b/pathod/pathod.py index 55e75074f..b80da8875 100644 --- a/pathod/pathod.py +++ b/pathod/pathod.py @@ -430,7 +430,7 @@ class Pathod(tcp.TCPServer): return self.log -def main(args): # pragma: nocover +def main(args): # pragma: no cover ssloptions = SSLOptions( cn=args.cn, confdir=args.confdir, diff --git a/pathod/pathod_cmdline.py b/pathod/pathod_cmdline.py index c92722494..1f972a491 100644 --- a/pathod/pathod_cmdline.py +++ b/pathod/pathod_cmdline.py @@ -226,6 +226,6 @@ def args_pathod(argv, stdout_=sys.stdout, stderr_=sys.stderr): return args -def go_pathod(): # pragma: nocover +def go_pathod(): # pragma: no cover args = args_pathod(sys.argv) pathod.main(args) diff --git a/pathod/utils.py b/pathod/utils.py index a1109a3c4..1e5bd9a46 100644 --- a/pathod/utils.py +++ b/pathod/utils.py @@ -98,7 +98,7 @@ class Data(object): data = Data(__name__) -def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): # pragma: nocover +def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): # pragma: no cover try: pid = os.fork() if pid > 0: diff --git a/setup.cfg b/setup.cfg index b1d62172f..7849ca079 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,5 @@ omit = *contrib*, *tnetstring*, *platform*, *console*, *main.py [coverage:report] show_missing = True exclude_lines = - pragma: nocover pragma: no cover raise NotImplementedError()