[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pybuild and unittest at build time



[Luca Falavigna, 2014-12-26]
> Hi,
> 
> A package I'd like to sponsor has a test suite [0], and I'd like to be
> able to run it at build time. Launching "python{,3} test_isoweek.py"
> seems enough to trigger the test suite.
> 
> pybuild is not able to run the test suite automatically, could you
> suggest me the best way to implement this feature?
> 
> [0] https://github.com/gisle/isoweek/blob/master/test_isoweek.py

if pybuild doesn't run it automatically, you can teach it:

 export PYBUILD_TEST_NOSE=1

or 

 export PYBUILD_TEST_PYTEST=1

or 

 override_dh_auto_test:
 	dh_auto_test -- --system=custom --test-args='{interpreter} isoweek/test_isoweek.py'

or... read pybuild manual for more :P

first two solutions require also additional build dependencie (both
test systems detest isoweek/test_isoweek.py correctly): python-nose  or
python-pytest (and python3-nose or python3-pytest if you're building
python3-isoweek)

Note that I also plan to invoke pytest or nose automatically if the
right test system is in Buil-Depends, but that's something for Stretch (Jessie+1)
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645


Reply to: