On Sat, Nov 14, 2026 at 08:29:46PM -0500, Nicholas D Steeves wrote:
>>> There doesn't seem to be any documentation on the following, so I think >>> it's worth having it here on-list, if nowhere else: >>> >>> I've been wondering how other developers make pytest run with -v, -vv, >>> or -vvv
>> >> You can simply add those to `export PYBUILD_TEST_ARGS=` in d/rules.
> > Don't these replace upstream's tool.pytest.ini_options in from > pyproject.toml? I thought that best practises would be something more > like 'PYBUILD_TEST_ARGS+= -vvv'.
I would be really surprised if there was a difference. Are you assuming that the default value of PYBUILD_TEST_ARGS is non-empty?
>>> I also wonder if anything special needs to be done for projects that use >>> a "coverage" type summary.
>> >> If the upstream already supports it you need to add explicit pytest-cov >> args to PYBUILD_TEST_ARGS, the same ones the upstream calls pytest with >> (remember that upstreams don't normally run tests by running pytest >> without args as we do, they use something like tox or hardcode pytest >> commands in their CI). If the upstream doesn't support it (e.g. it needs >> some project-level coverage config to make sense, or it needs direct >> coverage calls instead of pytest-cov) I wouldn't bother. >>
> > I used your hint about upstream pytest-cov to find that the place > upstream was enabling it was pyproject.toml -- a nice and simple case. > I tried patching it here with "-vvv" to see if our pybuild would use > upstream's tool.pytest.ini_options, and it did. > > Why is it better to manually copy and synchronise upstream's > tool.pytest.ini_options (pyproject.toml) to our PYBUILD_TEST_ARGS > (d/rules), and then manually keep them in sync?
Well, editing d/rules is almost always preferred to patching upstream sources. But if by copying you mean `addopts` from pyproject.toml are ignored by pybuild, that's unexpected.
-- WBR, wRAR