diff --git a/tests/import_subcommand.TestCase b/tests/import_subcommand.TestCase index 79222eab..1b3347ad 100755 --- a/tests/import_subcommand.TestCase +++ b/tests/import_subcommand.TestCase @@ -14,7 +14,6 @@ from unittest import mock from pathlib import Path import requests -from testcommon import TmpCwd, mkdtemp localmodule = Path(__file__).resolve().parent.parent print('localmodule: ' + str(localmodule)) @@ -25,6 +24,7 @@ import fdroidserver.common import fdroidserver.import_subcommand import fdroidserver.metadata from fdroidserver.exception import FDroidException +from testcommon import TmpCwd, mkdtemp class ImportTest(unittest.TestCase): diff --git a/tests/lint.TestCase b/tests/lint.TestCase index 5430eb7b..d9ac8de2 100755 --- a/tests/lint.TestCase +++ b/tests/lint.TestCase @@ -10,7 +10,6 @@ import sys import tempfile import unittest from pathlib import Path -from testcommon import mkdtemp localmodule = Path(__file__).resolve().parent.parent print('localmodule: ' + str(localmodule)) @@ -21,6 +20,7 @@ import fdroidserver.common import fdroidserver.lint import fdroidserver.metadata from fdroidserver.common import CATEGORIES_CONFIG_NAME +from testcommon import mkdtemp class LintTest(unittest.TestCase): diff --git a/tests/main.TestCase b/tests/main.TestCase index deaf9dff..9ce25a2b 100755 --- a/tests/main.TestCase +++ b/tests/main.TestCase @@ -8,7 +8,6 @@ import textwrap import unittest import tempfile from unittest import mock -from testcommon import TmpCwd, TmpPyPath localmodule = os.path.realpath( os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..') @@ -19,6 +18,7 @@ if localmodule not in sys.path: from fdroidserver import common import fdroidserver.__main__ +from testcommon import TmpCwd, TmpPyPath class MainTest(unittest.TestCase): diff --git a/tests/metadata.TestCase b/tests/metadata.TestCase index c4c58882..1a0a1bdc 100755 --- a/tests/metadata.TestCase +++ b/tests/metadata.TestCase @@ -15,8 +15,6 @@ from collections import OrderedDict from pathlib import Path from unittest import mock -from testcommon import TmpCwd, mkdtemp - localmodule = Path(__file__).resolve().parent.parent print('localmodule: ' + str(localmodule)) if localmodule not in sys.path: @@ -26,6 +24,7 @@ import fdroidserver from fdroidserver import metadata from fdroidserver.exception import MetaDataException from fdroidserver.common import DEFAULT_LOCALE +from testcommon import TmpCwd, mkdtemp def _get_mock_mf(s): diff --git a/tests/rewritemeta.TestCase b/tests/rewritemeta.TestCase index 00e4f354..f8388f88 100755 --- a/tests/rewritemeta.TestCase +++ b/tests/rewritemeta.TestCase @@ -8,14 +8,13 @@ import tempfile import textwrap from pathlib import Path -from testcommon import TmpCwd, mkdtemp - localmodule = Path(__file__).resolve().parent.parent print('localmodule: ' + str(localmodule)) if localmodule not in sys.path: sys.path.insert(0, str(localmodule)) from fdroidserver import common, metadata, rewritemeta +from testcommon import TmpCwd, mkdtemp class RewriteMetaTest(unittest.TestCase): diff --git a/tests/update.TestCase b/tests/update.TestCase index 6af32bb2..bc52981f 100755 --- a/tests/update.TestCase +++ b/tests/update.TestCase @@ -23,7 +23,6 @@ import textwrap from binascii import hexlify from datetime import datetime from pathlib import Path -from testcommon import TmpCwd, mkdtemp from unittest import mock try: @@ -61,6 +60,7 @@ import fdroidserver.metadata import fdroidserver.update from fdroidserver.common import CATEGORIES_CONFIG_NAME from fdroidserver.looseversion import LooseVersion +from testcommon import TmpCwd, mkdtemp DONATION_FIELDS = ('Donate', 'Liberapay', 'OpenCollective')