Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.maint.python > #16985
| From | Tianyu Chen <billchenchina2001@gmail.com> |
|---|---|
| Newsgroups | linux.debian.maint.python |
| Subject | tests defined in d/pybuild.testfiles tested twice |
| Date | 2025-08-08 05:10 +0200 |
| Message-ID | <LhlEt-5VO1-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Hi,
Yesterday I was packaging python-pywebpush[1]. To enable autopkgtest,
I used `Testsuite: autopkgtest-pkg-pybuild' in d/control. But when
autopkgtest stage, pytest didn't discover any tests. weepingclown and
I dug into the problem and found tests in pywebpush/tests are not
copied to the build directory; instead, pybuild only copies
pyproject.toml, pytest.ini, test, and tests directories. pybuild(1)
documented that "you can list them in debian/pybuild.testfiles file".
By creating d/pybuild.testfiles and adding "pywebpush/tests" to the
file, autopkgtest works. But reviewing the build log, we found all
tests are running twice in dh_auto_test. The log shows:
tests/test_webpush.py
pywebpush/tests/test_webpush.py
I asked on #debian-python IRC yesterday, and currently using `export
PYBUILD_TEST_ARGS=--ignore pywebpush/tests' to avoid being tested
twice. I also did some searching on codesearch.debian.net, and I found
that some other packages are either tested twice or doing similar
things to avoid being tested twice. Following are three attempts to
ensure tested only once:
src:isodate
export PYBUILD_BEFORE_TEST=cp -r {dir}/tests {build_dir}/
export PYBUILD_TEST_ARGS=tests/test_*.py
src:python-cymem
export PYBUILD_NAME = cymem
export PYBUILD_TEST_ARGS = tests
src:python-ewokscore
ifeq ($(PYBUILD_AUTOPKGTEST),1)
export PYBUILD_TEST_ARGS := {dir}/src/ewokscore
endif
Are there better solutions to this problem?
[1]: https://salsa.debian.org/homeassistant-team/deps/python-pywebpush/
Best Regards,
Tianyu Chen
Back to linux.debian.maint.python | Previous | Next — Next in thread | Find similar
tests defined in d/pybuild.testfiles tested twice Tianyu Chen <billchenchina2001@gmail.com> - 2025-08-08 05:10 +0200 Re: tests defined in d/pybuild.testfiles tested twice Colin Watson <cjwatson@debian.org> - 2025-08-08 11:30 +0200
csiph-web