Commit cde8f8ed authored by Bram Schoenmakers's avatar Bram Schoenmakers

Skip branch coverage measurement for default values with lambdas

The lambdas, which are not all run, cause coverage to think that the
jump to the function exit was never made, polluting the results.
Therefore add this pragma to mask these instances of missing branch
coverage.

See also:

https://bitbucket.org/ned/coveragepy/issues/90/lambda-expression-confuses-branch
parent faa9b61d
......@@ -30,7 +30,7 @@ from topydo.lib.TodoListBase import InvalidTodoException
class AddCommand(Command):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, # pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -20,7 +20,7 @@ from topydo.lib.TodoListBase import InvalidTodoException
class AppendCommand(Command):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -18,7 +18,7 @@ from topydo.lib.DCommand import DCommand
class DeleteCommand(DCommand):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -24,7 +24,7 @@ from topydo.lib.View import View
class DepCommand(Command):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -19,7 +19,7 @@ from topydo.lib.PrettyPrinterFilter import PrettyPrinterNumbers
class DepriCommand(MultiCommand):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -24,7 +24,7 @@ from topydo.lib.Utils import date_string_to_date
class DoCommand(DCommand):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -25,7 +25,7 @@ from topydo.lib.TodoListBase import InvalidTodoException
class ListCommand(ExpressionCommand):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -18,7 +18,7 @@ from topydo.lib.Command import Command
class ListContextCommand(Command):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -18,7 +18,7 @@ from topydo.lib.Command import Command
class ListProjectCommand(Command):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -24,7 +24,7 @@ from topydo.lib.Utils import date_string_to_date
class PostponeCommand(MultiCommand):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -22,7 +22,7 @@ from topydo.lib.Utils import is_valid_priority
class PriorityCommand(MultiCommand):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -21,7 +21,7 @@ from topydo.lib import TodoList
from topydo.lib.Config import config
class RevertCommand(Command):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -20,7 +20,7 @@ from topydo.lib.Sorter import Sorter
class SortCommand(Command):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -20,7 +20,7 @@ from topydo.lib.TodoListBase import InvalidTodoException
class TagCommand(Command):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -24,7 +24,7 @@ class InvalidCommandArgument(Exception):
class Command(object):
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -27,7 +27,7 @@ class DCommand(MultiCommand):
alike.
"""
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -28,7 +28,7 @@ class ExpressionCommand(Command):
A common class for commands operating on todos selected by expressions.
"""
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
......@@ -25,7 +25,7 @@ class MultiCommand(ExpressionCommand):
A common class for operations that can work with multiple todo IDs.
"""
def __init__(self, p_args, p_todolist,
def __init__(self, p_args, p_todolist, #pragma: no branch
p_out=lambda a: None,
p_err=lambda a: None,
p_prompt=lambda a: None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment