Path: csiph.com!aioe.org!bofh.it!news.nic.it!robomod From: Peter Pentchev Newsgroups: linux.debian.maint.python Subject: Re: Anyway to omit some tests within unittest framework? Date: Sun, 14 Jun 2020 01:10:01 +0200 Message-ID: References: X-Mailbox-Line: From debian-python-request@lists.debian.org Sat Jun 13 23:01:43 2020 Old-Return-Path: X-Amavis-Spam-Status: No, score=-11.979 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5, MURPHY_DRUGS_REL8=0.02, PGPSIGNATURE=-5, UNPARSEABLE_RELAY=0.001] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate: -4.6 X-Greylist: delayed 439 seconds by postgrey-1.36 at bendel; Sat, 13 Jun 2020 23:01:30 UTC MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline X-Mailing-List: archive/latest/18364 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/20200613225406.GA361726@straylight.m.ringlet.net Approved: robomod@news.nic.it Lines: 72 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: debian-python@lists.debian.org X-Original-Date: Sun, 14 Jun 2020 01:54:06 +0300 X-Original-Message-ID: <20200613225406.GA361726@straylight.m.ringlet.net> X-Original-References: Xref: csiph.com linux.debian.maint.python:12657 --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 13, 2020 at 09:05:23PM +0800, zhao feng wrote: > Recently I want to make a debian package of a scientific computing > library. I try to use > pybuild in my debian/rules. I found some tests failed because the test > code downloads some data from the internet when the test code is > running for the first time. I want to omit these tests. However, the > test uses Python built-in unittests I do not find any switch to omit a > small number of tests (it seems only supporting selecting which tests > to include). The document in pybuild mentions that it is possible for > `pytest` framework > (https://wiki.debian.org/Python/Pybuild#debian.2Fcontrol). > Since pybuild wraps the command line switch of these frameworks. I > think it is hard to find solution on pybuild level if unittests do not > support it. As far as I can figure out, I can inject some decorator to > the test code to omit these test functions, I do not know whether it > is acceptable to make such "patch" in debian. I wonder if there were > any way to deal with this kind of problems. >=20 > Some additional informations: > https://salsa.debian.org/zhaofeng-shu33-guest/ete is the source code > repo. It is possible to explicitly tell pybuild to use pytest for testing; see the PYBUILD_TEST_PYTEST variable that I use e.g. in https://sources.debian.org/src/confget/2.3.4-1/debian/rules/#L33 and the following couple of lines. I expect that in this case you'd want to set the PYBUILD_TEST_ARGS variable to the arguments that pytest will be invoked with, e.g. -k 'not something' to exclude certain tests and maybe the path to the unit tests directory and, if really necessary, --rootdir. I'm sorry, I cannot do any actual tests with your package right now. If you run into problems, I could fetch it from your Git repository and try a couple of things, but it will have to wait a day or two. Hope that helps! G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@debian.org pp@storpool.com PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13 --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7lWQUACgkQZR7vsCUn 3xOrBA//UQIEkiadffTn4XVIwKaUyfIjakHP0RLFGBfmwxow/eJL3SBRvRZAAlYi s+QFgdFb8ULcOZJe+zqCfg4DjYQfpCl5xe6XAsUA9L616CkYd4x1h6D8wUcxpBrT 3tJHwmCBeKzq6DO4wtsHhub9G7Y1Qh2UAjt2S41jkKO1LWkQhmi9p0JK6GuWsXq7 BovrRr6ybGrmAlNRnr+cFDlRRXwCFQOhWsIV71oUhfu825a29pPhbi9JTXzixLd8 PIsNYZ0LJLwjICpSpnyh7HjX6AnPlHzRD1qG95uVA6dFwUGx7a2YaEGSLpNGxyWE k89NEvmTMK4FG7+44dLxx0+e4gs5iWYQ63zAhT6vzf7t+zpa40q5c/j/i8lvkT71 kRerziU1Vz9nzeAcQRh5K0Fzs6UJs9NkVYzh+v1TE75sngISKqBf0BmaM4P7/4xj IXJ7lZRa494vGytzCiO4wn/5dkBp4AenC7ToEu1PWWqxWahl8XNTGhHUw1hRZEO8 FYCwkThAm+mikx05imgmm7ZfxTZX3s0rhHrplwDsgDes3GCV6jiUCmfGo9U7JLTK W2gRmzdpKcpaf05utfFVrDs0YaUcMsuSvB1UkDgg5JHkCGmmu4lw0dLzgK0xt72v iJhpMO4yH9vKAfYbsCRDNsf7n4uFUJKTDchSA6XHRSL8KraeKaA= =Agr7 -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT--