summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2022-05-17 15:01:19 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2022-06-08 16:43:52 +0100
commite3fab09382d4a6c439820ed5e6930e57716dcb50 (patch)
tree75bd89dbae775c6e0b255453a67dbde3a824f879 /setup.py
parentb9f79758c973db088b5c687425c6613796fdb250 (diff)
downloadlibvirt-python-e3fab09382d4a6c439820ed5e6930e57716dcb50.tar.gz
tests: use mocks to allow calling virEventRegisterImpl many times
We currently have to run each of the test_aio.py test cases in a separate process, because libvirt.virEventRegisterImpl can only be called once per process. This leads to quite unpleasant console output when running tests. By introducing a mock for libvirt.virEventRegisterImpl we can regain the ability to run everything in a single process. The only caveat is that it relies on tests to fully cleanup, but in practice this is ok for our current tests. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/setup.py b/setup.py
index 3e99ac4..33f6187 100755
--- a/setup.py
+++ b/setup.py
@@ -310,19 +310,7 @@ class my_test(Command):
os.environ["PYTHONPATH"] = self.build_platlib
pytest = self.find_pytest_path()
-
- # Run the normal tests.
- subprocess.check_call([pytest, "-m", "not separate_process"])
-
- # Run the tests that require their own process.
- testlist = subprocess.run(
- [pytest, "--collect-only", "--quiet", "-m", "separate_process"],
- check=True, stdout=subprocess.PIPE)
- testlist = testlist.stdout.decode("utf-8").splitlines()
- testlist = filter(
- lambda test: test and "tests collected" not in test, testlist)
- for test in testlist:
- subprocess.check_call([pytest, test])
+ subprocess.check_call([pytest])
class my_clean(Command):
def run(self):