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

Reply via email to