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


Groups > linux.debian.maint.python > #8195

Re: Test suite needs script built after dh_auto_test is run

From Barry Warsaw <barry@python.org>
Newsgroups linux.debian.devel.mentors, linux.debian.maint.python
Subject Re: Test suite needs script built after dh_auto_test is run
Date 2016-02-05 20:20 +0100
Message-ID <qYU5c-4l7-41@gated-at.bofh.it> (permalink)
References <qYFSz-3zj-19@gated-at.bofh.it>
Organization Damn Crazy Followers of the Horn

Cross-posted to 2 groups.

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Feb 04, 2016, at 09:08 PM, Sean Whitton wrote:

>I'm packaging a Python application, ocrmypdf [1], that has a test suite
>run by py.test.  Most of the tests fail because they try to call the
>/usr/bin/ocrmypdf script.  This script doesn't exist until after
>debhelper has run setup.py, which generates it using its "entry points
>script" feature.  And this comes after dh_auto_test.
>
>The only solution I've come up with is producing my own entry point
>script and putting it into $PATH for the test suite to use.  But that
>rather defeats the purpose of testing the actual package's contents.

There are a few approaches I've taken in similar situations.

If ocrmypdf supports Python's -m option, you could consider patching the test
suite to run `python -m ocrmydf` instead.  Season to taste for python3 and or
both if you're using pybuild.

If the package uses tox to run its test suite, then you'll have the executable
in .tox/pyXY/bin and you could try to run that instead.

As a last resort, I have disabled the build-time tests (all or only the ones
that require the /usr/bin) and then arranged for the full test suite to run
via autopkgtest/DEP-8.  It's not ideal because Debian currently doesn't gate
on DEP-8 passing, but Ubuntu does and at least I'll see failures there.

FWIW, I think it's almost always a good idea to add a simple DEP-8 smoke test
for Python packages, just to prove that the modules can be imported if nothing
else.

Cheers,
-Barry

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Test suite needs script built after dh_auto_test is run Sean Whitton <spwhitton@spwhitton.name> - 2016-02-05 05:10 +0100
  Re: Test suite needs script built after dh_auto_test is run Barry Warsaw <barry@python.org> - 2016-02-05 20:20 +0100
    Re: Test suite needs script built after dh_auto_test is run Sean Whitton <spwhitton@spwhitton.name> - 2016-02-07 00:20 +0100

csiph-web