summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2020-01-27 10:44:09 -0500
committerCole Robinson <crobinso@redhat.com>2020-01-27 13:08:12 -0500
commit3440d8c59d70d0e81ab3a713d70cc801b0de088f (patch)
treed8fa42abd896682f25b5d478f5ec420055af9697 /setup.py
parentc64009ecddbc2a9d9fd14a06dc99b599ce0878e5 (diff)
downloadvirt-manager-3440d8c59d70d0e81ab3a713d70cc801b0de088f.tar.gz
urlfetcher: move mock code to the testsuite
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 049e6bea..9b91a0dc 100755
--- a/setup.py
+++ b/setup.py
@@ -417,6 +417,7 @@ class TestBaseCommand(distutils.core.Command):
self.testfile = None
self._force_verbose = False
self._external_coverage = False
+ self._urlfetcher_mock = False
def finalize_options(self):
if self.only:
@@ -462,6 +463,9 @@ class TestBaseCommand(distutils.core.Command):
for key, val in self._clistate.items():
setattr(testsmodule.utils.clistate, key, val)
testsmodule.setup_logging()
+ if self._urlfetcher_mock:
+ import tests.urlfetcher_mock
+ tests.urlfetcher_mock.setup_mock()
# This makes the test runner report results before exiting from ctrl-c
unittest.installHandler()
@@ -523,6 +527,7 @@ class TestCommand(TestBaseCommand):
'''
Finds all the tests modules in tests/, and runs them.
'''
+ self._urlfetcher_mock = True
excludes = ["test_dist.py", "test_urls.py", "test_inject.py"]
testfiles = self._find_tests_in_dir("tests", excludes)