Skip to content

Commit

Permalink
get 100% coverage, exclude tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ykshatroff committed Apr 15, 2020
1 parent 4b5a15a commit 7c5e749
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
@@ -1,7 +1,7 @@
[run]
branch = True
parallel = True
omit = setup.py, */migrations/*, */conftest.py
omit = setup.py, */migrations/*, djclick/test/*

[report]
show_missing = true
Expand Down
9 changes: 5 additions & 4 deletions djclick/adapter.py
Expand Up @@ -10,8 +10,9 @@


class OptionParseAdapter(object):
"""Django pre-1.10-compatible adapter, deprecated"""
def parse_args(self, args):
return (self, None)
return (self, None) # NOCOV


class ArgumentParserDefaults(object):
Expand Down Expand Up @@ -49,7 +50,7 @@ def invoke(self, ctx):
return super(DjangoCommandMixin, self).invoke(ctx)
except CommandError as e:
# Honor the --traceback flag
if ctx.traceback:
if ctx.traceback: # NOCOV
raise
click.echo('{}: {}'.format(e.__class__.__name__, e), err=True)
ctx.exit(1)
Expand All @@ -61,7 +62,7 @@ def run_from_argv(self, argv):
try:
return self.main(args=argv[2:], standalone_mode=False)
except click.ClickException as e:
if getattr(e.ctx, 'traceback', False):
if getattr(e.ctx, 'traceback', False): # NOCOV
raise
e.show()
sys.exit(e.exit_code)
Expand All @@ -72,7 +73,7 @@ def create_parser(self, progname, subcommand):
"""
if DJANGO_VERSION >= (1, 10):
return ArgumentParserAdapter()
else:
else: # NOCOV
return OptionParseAdapter()

def print_help(self, prog_name, subcommand):
Expand Down
2 changes: 1 addition & 1 deletion djclick/params.py
Expand Up @@ -17,7 +17,7 @@ def __init__(self, qs, lookup='pk'):
self.lookup = lookup

def convert(self, value, param, ctx):
if value is None:
if value is None: # NOCOV
return super(ModelInstance, self).convert(value, param, ctx)
try:
return self.qs.get(**{self.lookup: value})
Expand Down

0 comments on commit 7c5e749

Please sign in to comment.