Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.maint.python > #16445
| From | Antonio Terceiro <terceiro@debian.org> |
|---|---|
| Newsgroups | linux.debian.maint.python |
| Subject | Re: Testsuite: autopkgtest-pkg-pybuild: weird behavior in my uploaded package |
| Date | 2024-11-11 22:40 +0100 |
| Message-ID | <JHKiB-8gT6-13@gated-at.bofh.it> (permalink) |
| References | <JGrBn-7rfh-3@gated-at.bofh.it> <JGrBn-7rfh-1@gated-at.bofh.it> <JGtjP-7svs-11@gated-at.bofh.it> <JGupz-7tes-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Fri, Nov 08, 2024 at 03:27:12PM +0500, Andrey Rakhmatullin wrote:
> On Fri, Nov 08, 2024 at 10:03:18AM +0100, Roland Mas wrote:
> > You need to list the files required for testing in debian/pybuild.testfiles.
> > Then both dh_auto_test and autopkgtest-pkg-pybuild do the right thing.
>
> This is the thing I didn't want to suggest, because dh_auto_test already
> works.
One issue is that the tests assume that the code to be imported is on a
parent directory, and that does not really work when running against the
installed code.
I got it to work by making these changes to the upstream tests:
----------------8<----------------8<----------------8<-----------------
--- fscacher-0.4.1.orig/src/fscacher/tests/test_cache.py
+++ fscacher-0.4.1/src/fscacher/tests/test_cache.py
@@ -8,8 +8,8 @@ import subprocess
import sys
import time
import pytest
-from .. import PersistentCache
-from ..cache import DirFingerprint, FileFingerprint
+from fscacher import PersistentCache
+from fscacher.cache import DirFingerprint, FileFingerprint
platform_system = platform.system().lower()
on_windows = platform_system == "windows"
--- fscacher-0.4.1.orig/src/fscacher/tests/test_util.py
+++ fscacher-0.4.1/src/fscacher/tests/test_util.py
@@ -1,5 +1,5 @@
import pytest
-from ..cache import xor_bytes
+from fscacher.cache import xor_bytes
@pytest.mark.parametrize(
----------------8<----------------8<----------------8<-----------------
And these changes to the Debian packaging:
----------------8<----------------8<----------------8<-----------------
diff -Nru fscacher-0.4.1/debian/control fscacher-0.4.1/debian/control
--- fscacher-0.4.1/debian/control 2024-11-08 12:47:13.000000000 -0300
+++ fscacher-0.4.1/debian/control 2024-11-11 18:13:06.000000000 -0300
@@ -11,7 +11,7 @@
python3-pytest-cov,
python3-pytest-mock,
Standards-Version: 4.6.2.0
-Testsuite: autopkgtest-pkg-python
+Testsuite: autopkgtest-pkg-pybuild
Homepage: https://github.com/con/fscacher
Rules-Requires-Root: no
diff -Nru fscacher-0.4.1/debian/pybuild.testfiles fscacher-0.4.1/debian/pybuild.testfiles
--- fscacher-0.4.1/debian/pybuild.testfiles 1969-12-31 21:00:00.000000000 -0300
+++ fscacher-0.4.1/debian/pybuild.testfiles 2024-11-11 18:14:07.000000000 -0300
@@ -0,0 +1 @@
+src/fscacher/tests
----------------8<----------------8<----------------8<-----------------
Back to linux.debian.maint.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Testsuite: autopkgtest-pkg-pybuild: weird behavior in my uploaded package Andrey Rakhmatullin <wrar@debian.org> - 2024-11-08 08:30 +0100
Re: Testsuite: autopkgtest-pkg-pybuild: weird behavior in my uploaded package Roland Mas <lolando@debian.org> - 2024-11-08 10:20 +0100
Re: Testsuite: autopkgtest-pkg-pybuild: weird behavior in my uploaded package Andrey Rakhmatullin <wrar@debian.org> - 2024-11-08 11:30 +0100
Re: Testsuite: autopkgtest-pkg-pybuild: weird behavior in my uploaded package Antonio Terceiro <terceiro@debian.org> - 2024-11-11 22:40 +0100
csiph-web