mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-07-28 15:41:52 +03:00
Fix nosetests usage with python3
Add RPM deps on python/python3-nose, make RPM build run the test suite and invoke nosetests using correct python binary Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
@ -14,8 +14,10 @@ License: LGPLv2+
|
|||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
BuildRequires: libvirt-devel >= @C_VERSION@
|
BuildRequires: libvirt-devel >= @C_VERSION@
|
||||||
BuildRequires: python-devel
|
BuildRequires: python-devel
|
||||||
|
BuildRequires: python-nose
|
||||||
%if %{with_python3}
|
%if %{with_python3}
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
|
BuildRequires: python3-nose
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_python3}
|
%if %{with_python3}
|
||||||
@ -60,6 +62,12 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
|||||||
%endif
|
%endif
|
||||||
rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info
|
rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info
|
||||||
|
|
||||||
|
%check
|
||||||
|
%{__python} setup.py test
|
||||||
|
%if %{with_python3}
|
||||||
|
%{__python3} setup.py test
|
||||||
|
%endif
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
|
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
|
||||||
|
2
setup.py
2
setup.py
@ -291,7 +291,7 @@ class my_test(Command):
|
|||||||
else:
|
else:
|
||||||
os.environ["PYTHONPATH"] = self.build_platlib
|
os.environ["PYTHONPATH"] = self.build_platlib
|
||||||
self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
|
self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
|
||||||
self.spawn(["nosetests"])
|
self.spawn([sys.executable, "/usr/bin/nosetests"])
|
||||||
|
|
||||||
|
|
||||||
class my_clean(clean):
|
class my_clean(clean):
|
||||||
|
Reference in New Issue
Block a user