Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #8845 > unrolled thread

dh_auto_test versus nosetests3

Started byu <u@451f.org>
First post2016-09-06 16:30 +0200
Last post2016-09-06 16:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.debian.maint.python


Contents

  dh_auto_test versus nosetests3 u <u@451f.org> - 2016-09-06 16:30 +0200
    Re: dh_auto_test versus nosetests3 Piotr Ożarowski <piotr@debian.org> - 2016-09-06 16:40 +0200

#8845 — dh_auto_test versus nosetests3

Fromu <u@451f.org>
Date2016-09-06 16:30 +0200
Subjectdh_auto_test versus nosetests3
Message-ID<sepxT-3ab-13@gated-at.bofh.it>
Hi!

I have a package where upstream provides tests.
These tests, when run with nosetests3, work correctly.

Currently, I build the package using (debian/rules):

 %:
   dh $@ --with python3 --buildsystem=pybuild


But some of the tests fail this way (see log below, for better readability).


Now, when I override dh_auto_test in debian/rules like so:

 override_dh_auto_test:
     nosetests3 --verbose --exe -w $(CURDIR)

The tests get executed without error but I have no real feedback about
their well-being (except when I check the build log) and obviously I get
a complaint that the package does not use tests anymore.

So what's best practice / recommendation here or what did I miss?

Thanks & cheers!
u.


Output build log (using pbuilder in a sid chroot):
--------------------------------------------------


I: pybuild base:184: cd
/build/onionshare-0.9/.pybuild/pythonX.Y_3.5/build; python3.5 -m nose test
..EE..
======================================================================
ERROR: load_strings() loads English by default
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File
"/build/onionshare-0.9/.pybuild/pythonX.Y_3.5/build/test/onionshare_strings_test.py",
line 33, in test_load_strings_defaults_to_english
    strings.load_strings()
  File
"/build/onionshare-0.9/.pybuild/pythonX.Y_3.5/build/onionshare/strings.py",
line 40, in load_strings
    for filename in os.listdir(locale_dir):
FileNotFoundError: [Errno 2] No such file or directory:
'/build/onionshare-0.9/.pybuild/pythonX.Y_3.5/build/resources/locale'

======================================================================
ERROR: load_strings() loads other languages in different locales
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File
"/build/onionshare-0.9/.pybuild/pythonX.Y_3.5/build/test/onionshare_strings_test.py",
line 40, in test_load_strings_loads_other_languages
    strings.load_strings("fr")
  File
"/build/onionshare-0.9/.pybuild/pythonX.Y_3.5/build/onionshare/strings.py",
line 40, in load_strings
    for filename in os.listdir(locale_dir):
FileNotFoundError: [Errno 2] No such file or directory:
'/build/onionshare-0.9/.pybuild/pythonX.Y_3.5/build/resources/locale'

----------------------------------------------------------------------
Ran 6 tests in 0.130s

FAILED (errors=2)
E: pybuild pybuild:276: test: plugin distutils failed with: exit code=1:
cd /build/onionshare-0.9/.pybuild/pythonX.Y_3.5/build; python3.5 -m nose
test
dh_auto_test: pybuild --test --test-nose -i python{version} -p 3.5
returned exit code 13

[toc] | [next] | [standalone]


#8846

FromPiotr Ożarowski <piotr@debian.org>
Date2016-09-06 16:40 +0200
Message-ID<sepHA-3dy-11@gated-at.bofh.it>
In reply to#8845
pybuild invokes tests from within build directory (for a very good reason)
You can patch the code to use f.e. env. var. that points to resources
directory or you can copy needed files to build directory with something like:

 export PYBUILD_BEFORE_TEST=cp -r {dir}/resources {build_dir}
 export PYBUILD_AFTER_TEST=rm -r {build_dir}/resources
-- 
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web