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


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

Re: Questions about including tests/ directory into package

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Diane Trout <diane@ghic.org>
Newsgroups linux.debian.maint.python
Subject Re: Questions about including tests/ directory into package
Date Thu, 19 Mar 2020 19:00:01 +0100
Message-ID <zM7Cx-734-3@gated-at.bofh.it> (permalink)
References <zM7Cx-734-5@gated-at.bofh.it> <zLWQO-zz-3@gated-at.bofh.it>
X-Mailbox-Line From debian-python-request@lists.debian.org Thu Mar 19 17:58:17 2020
Old-Return-Path <diane@ghic.org>
X-Amavis-Spam-Status No, score=-4.363 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5, MEDS2=2, SARE_MSGID_LONG40=0.637] autolearn=no autolearn_force=no
X-Policyd-Weight using cached result; rate:hard: -4.6
X-Greylist delayed 1155 seconds by postgrey-1.36 at bendel; Thu, 19 Mar 2020 17:58:04 UTC
Content-Type text/plain; charset="UTF-8"
User-Agent Evolution 3.30.5-1.1
MIME-Version 1.0
Content-Transfer-Encoding 7bit
X-Mailing-List <debian-python@lists.debian.org> archive/latest/18014
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/519df6b3a6d0a62b37a7aab109e534cd6a0f2c42.camel@ghic.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Thu, 19 Mar 2020 10:38:43 -0700
X-Original-Message-ID <519df6b3a6d0a62b37a7aab109e534cd6a0f2c42.camel@ghic.org>
X-Original-References <CAGzOMC8pnRLnB=RSxKmKAJzGrzDpYA1dfuapW7=p6JCMTxNQ=g@mail.gmail.com>
Xref csiph.com linux.debian.maint.python:12370

Show key headers only | View raw


On Thu, 2020-03-19 at 15:22 +0900, Sao I Kuan wrote:
> Hi,
> 
> I'm newcomer to Debian packaging, and trying to add the autopkgtest
> test script into python-tinyalign[1].
> 
>     [1] https://salsa.debian.org/med-team/python-tinyalign
> 
> And now I'm facing a (maybe simple) problem.
> 
> The upstream test files are located in tests/ directory, but seems
> this directory is excluded during packaging.
> I have no idea how to include this tests/ directory.

The way I solved that problem in a similar package was this

Test-Command: set -e
 ; for py in $(py3versions -r 2>/dev/null)
 ; do cd tests
 ; echo "Testing with $py in $(pwd):"
 ; http_proxy= $py -m pytest -v --pyargs 
 ; done
Depends: @, python3-all, python3-pytest

The goal of autopkgtests is to test the installed package, when
autopkgtest starts running it defaults to starting in the extracted
copy of the source package.

The goal is to make sure you test the copy in /usr/lib/python*/dist-
packages. So I assumed if cd-ed into the tests directory the package
source module wouldn't be available to the test runner.

I did make the assumption that none of the tests messed with the python
path  to look in the parent directory...

If that's a problem, maybe copy the contents of tests/ to
$AUTOPKGTEST_TMP and run the tests there.

Hope that helps,
Diane

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


Thread

Questions about including tests/ directory into package Sao I Kuan <saoikuan@gmail.com> - 2020-03-19 07:30 +0100
  Re: Questions about including tests/ directory into package Diane Trout <diane@ghic.org> - 2020-03-19 19:00 +0100
    Re: Questions about including tests/ directory into package Sao I Kuan <saoikuan@gmail.com> - 2020-03-20 12:30 +0100
  Re: Questions about including tests/ directory into package Sandro Tosi <morph@debian.org> - 2020-03-21 00:50 +0100

csiph-web