diff --git a/runtests.py b/runtests.py index f97de01..604568b 100755 --- a/runtests.py +++ b/runtests.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python3 # # Copyright (c) 2008-2009 Red Hat, Inc. # @@ -19,6 +19,7 @@ import os import shutil import sys import tempfile +import nose # Make sure we run from the source, this is tricky because the functional # tests need to find both the location of the 'tito' executable script, @@ -34,7 +35,6 @@ SRC_BIN_DIR = os.path.abspath(os.path.join(TEST_SCRIPT_DIR, "bin/")) os.environ['TITO_SRC_BIN_DIR'] = SRC_BIN_DIR if __name__ == '__main__': - import nose print("Using Python %s" % sys.version) print("Using nose %s" % nose.__version__) diff --git a/test/functional/release_copr_tests.py b/test/functional/release_copr_tests.py index 2e3558a..a89e986 100644 --- a/test/functional/release_copr_tests.py +++ b/test/functional/release_copr_tests.py @@ -15,12 +15,12 @@ Functional Tests for the CoprReleaser. """ +from unittest import mock + from functional.fixture import TitoGitTestFixture -from unittest import mock from tito.compat import * # NOQA from tito.release import CoprReleaser -from unit import Capture PKG_NAME = "releaseme" diff --git a/test/unit/bugtracker_tests.py b/test/unit/bugtracker_tests.py index 3d2e3b7..481b2f0 100644 --- a/test/unit/bugtracker_tests.py +++ b/test/unit/bugtracker_tests.py @@ -1,7 +1,8 @@ import unittest -from tito.bugtracker import BugzillaExtractor from unittest.mock import Mock, patch +from tito.bugtracker import BugzillaExtractor + class ExtractBugzillasTest(unittest.TestCase): diff --git a/test/unit/common_tests.py b/test/unit/common_tests.py index 2127c85..31625eb 100644 --- a/test/unit/common_tests.py +++ b/test/unit/common_tests.py @@ -1,4 +1,3 @@ -# # Copyright (c) 2008-2009 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, @@ -13,6 +12,18 @@ # in this software or its documentation. """ Pure unit tests for tito's common module. """ + +import os +import re +import unittest + +from unittest.mock import patch, call +from tempfile import NamedTemporaryFile +from textwrap import dedent +from unit import open_mock, Capture +from blessed import Terminal + +# Pure unit tests for tito's common module from tito.common import (replace_version, find_spec_like_file, increase_version, search_for, compare_version, run_command_print, find_wrote_in_rpmbuild_output, render_cheetah, increase_zstream, reset_release, find_file_with_extension, @@ -23,15 +34,6 @@ from tito.common import (replace_version, find_spec_like_file, increase_version, from tito.compat import StringIO from tito.tagger import CargoBump -import os -import re -import unittest - -from unittest.mock import Mock, patch, call -from tempfile import NamedTemporaryFile -from textwrap import dedent -from unit import open_mock, Capture -from blessed import Terminal class CommonTests(unittest.TestCase):