summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2014-03-18 11:11:48 +0000
committerDaniel P. Berrange <berrange@redhat.com>2014-03-19 15:16:15 +0000
commiteaded7bdadf3ccdc4b208ec0ed65a1b23b8b5f69 (patch)
tree894d5dd6ca0ef88908550bf1db64824af7bb810b /setup.py
parent69c4600d61fa74c4977d2471a29fb73f0fe5edb0 (diff)
downloadlibvirt-python-eaded7bdadf3ccdc4b208ec0ed65a1b23b8b5f69.tar.gz
Add support for running unit tests with nose
Make the 'python setup.py test' able to run unit tests found under tests/ through the 'nosetests' command Signed-off-by: Daniel P. Berrange <berrange@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 773cef3..cfbbe2c 100755
--- a/setup.py
+++ b/setup.py
@@ -267,7 +267,12 @@ class my_test(Command):
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
self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
+ self.spawn(["nosetests"])
class my_clean(clean):