Setuptools / dpkg-buildpackage: refuse build if fail

I have a very simple python package that I create in debian packages using setuptools, cdbs and pycentral:

setup.py:

from setuptools import setup
setup(name='PHPSerialize',
  version='1.0',
  py_modules=['PHPSerialize'],
  test_suite = 'nose.collector'
 )

Debian / rules:

#!/usr/bin/make -f
DEB_PYTHON_SYSTEM = pycentral

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

Now, is there an easy way to make dpkg-buildpackage run unit tests and refuse to create .deb if the test suite does not work?

+3
source share
1 answer

Try

build/yourpackage::
         nosetests
+2
source

Source: https://habr.com/ru/post/1714390/


All Articles