From 6092f9e2ae01116a83979c81ff48b5a474e4cb48 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Jun 01 2017 07:39:25 +0000 Subject: coverage for py3 unit tests --- diff --git a/Makefile b/Makefile index 7132fe3..e8062bb 100644 --- a/Makefile +++ b/Makefile @@ -71,8 +71,13 @@ test: @echo Coverage report in htmlcov/index.html test3: - PYTHONPATH=hub/.:plugins/hub/.:plugins/builder/. python3 -m nose tests/test_lib tests/test_cli - @echo Coverage not working for py3 tests yet + coverage erase + PYTHONPATH=hub/.:plugins/hub/.:plugins/builder/. nosetests-3 \ + --with-coverage --cover-package . tests/test_lib tests/test_cli + @echo Sleeping to work around an issue + sleep 10 + coverage html + @echo Coverage report in htmlcov/index.html subdirs: for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1; done diff --git a/tests/test_cli/test_list_commands.py b/tests/test_cli/test_list_commands.py index b73ade0..a26d1a6 100644 --- a/tests/test_cli/test_list_commands.py +++ b/tests/test_cli/test_list_commands.py @@ -31,7 +31,7 @@ class TestListCommands(unittest.TestCase): if six.PY2: actual = actual.replace('nosetests', 'koji') else: - actual = actual.replace('python3 -m nose', 'koji') + actual = actual.replace('nosetests-3', 'koji') filename = os.path.dirname(__file__) + '/data/list-commands.txt' with open(filename, 'rb') as f: expected = f.read().decode('ascii') @@ -47,7 +47,7 @@ class TestListCommands(unittest.TestCase): if six.PY2: actual = actual.replace('nosetests', 'koji') else: - actual = actual.replace('python3 -m nose', 'koji') + actual = actual.replace('nosetests-3', 'koji') filename = os.path.dirname(__file__) + '/data/list-commands-admin.txt' with open(filename, 'rb') as f: expected = f.read().decode('ascii')