From 4e5d903fc343501ac9a2be5584925f0d64d1e6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 22 Mar 2022 17:44:02 +0000 Subject: sanitytest: stop passing API XML path into sanity test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want to move over to make sanitytest.py operate like a more normal test script, which means making it self contained. The test already knows how to find the libvirt API XML path using pkg-config and if an override location is required, this can be done by pointing $PKG_CONFIG_PATH to a suitable place. Signed-off-by: Daniel P. Berrangé --- sanitytest.py | 7 +------ setup.py | 4 +--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sanitytest.py b/sanitytest.py index 5b5ad68..86b7dca 100644 --- a/sanitytest.py +++ b/sanitytest.py @@ -20,12 +20,7 @@ def get_libvirt_api_xml_path(): sys.exit(proc.returncode) return stdout.splitlines()[0] - -# Path to the libvirt API XML file -if len(sys.argv) >= 3: - xml = sys.argv[2] -else: - xml = get_libvirt_api_xml_path() +xml = get_libvirt_api_xml_path() with open(xml, "r") as fp: tree = lxml.etree.parse(fp) diff --git a/setup.py b/setup.py index f48c5ab..729481e 100755 --- a/setup.py +++ b/setup.py @@ -304,15 +304,13 @@ class my_test(Command): Run test suite """ - apis = get_api_xml_files() - if "PYTHONPATH" in os.environ: os.environ["PYTHONPATH"] = self.build_platlib + ":" + os.environ["PYTHONPATH"] else: os.environ["PYTHONPATH"] = self.build_platlib if "LIBVIRT_API_COVERAGE" in os.environ: - self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]]) + self.spawn([sys.executable, "sanitytest.py", self.build_platlib]) pytest = self.find_pytest_path() subprocess.check_call([pytest]) -- cgit v1.2.1