From dc411d9456fdb80cd836f729a509073fa9953dde Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Dec 19 2017 14:59:40 +0000 Subject: PR#757: Force coverage3 read correct rc file. Merges #757 https://pagure.io/koji/pull-request/757 Fixes: #756 https://pagure.io/koji/issue/756 coverage3 should read .coveragerc3 to generate reports or html --- diff --git a/.coveragerc b/.coveragerc index f375367..14a1aca 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,3 +3,8 @@ omit = /usr/* tests/* + +[report] +exclude_lines = + pragma: no cover + no cover: 2.x diff --git a/.coveragerc3 b/.coveragerc3 index 236173b..8bd87e7 100644 --- a/.coveragerc3 +++ b/.coveragerc3 @@ -10,3 +10,9 @@ omit = koji/ssl/* koji/daemon.py koji/tasks.py + +[report] +exclude_lines = + pragma: no cover + no cover 3.x + if six.PY2 diff --git a/Makefile b/Makefile index 21e6ff3..2db779b 100644 --- a/Makefile +++ b/Makefile @@ -78,8 +78,8 @@ test3: --rcfile .coveragerc3 --source . \ /usr/bin/nosetests-3 \ tests/test_lib tests/test_cli - coverage report - coverage html + coverage report --rcfile .coveragerc3 + coverage html --rcfile .coveragerc3 @echo Full coverage report at file://${PWD}/htmlcov/index.html test-tarball: diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 2904297..c3a66d7 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -43,7 +43,7 @@ from koji_cli.lib import _, OptionParser, activate_session, parse_arches, \ def _printable_unicode(s): if six.PY2: return s.encode('utf-8') - else: + else: # no cover: 2.x return s @@ -1223,7 +1223,7 @@ def handle_import(goptions, session, args): if need_build: # if we're doing this here, we weren't given the matching srpm - if not options.create_build: + if not options.create_build: # pragma: no cover if binfo: # should have caught this earlier, but just in case... b_state = koji.BUILD_STATES[binfo['state']] @@ -1373,7 +1373,7 @@ def _import_comps(session, filename, tag, options): # libcomps does not support metapkgs -def _import_comps_alt(session, filename, tag, options): +def _import_comps_alt(session, filename, tag, options): # no cover 3.x """Import comps data using yum.comps module""" print('WARN: yum.comps does not support the biarchonly of group and basearchonly of package') comps = yumcomps.Comps()