On Wed, Nov 06, 2024 at 02:29:34PM -0700, Soren Stoutner wrote: > On Friday, November 1, 2024 4:03:45 PM MST Soren Stoutner wrote: > > I: pybuild base:311: cd /tmp/autopkgtest-lxc.ntf_swjm/downtmp/ > autopkgtest_tmp/ > > build; python3.12 -m pytest -k 'not test_find_module and not > > test_metadata_searching and not test_Qt_QTranslate and not test_zeep and not > > test_scapy3 and not test_zope_interface and not test_gevent and not > > test_user_preferred_locale and not test_pytz' > > usage: __main__.py [-h] [--link-only] {samedir,subdir,parentdir} > > __main__.py: error: argument test_type: invalid choice: 'not > > test_find_module > > and not test_metadata_searching and not test_Qt_QTranslate and not test_zeep > > and not test_scapy3 and not test_zope_interface and not test_gevent and not > > test_user_preferred_locale and not test_pytz' (choose from 'samedir', > > 'subdir', ‘parentdir’) > > My experience with another package is that -k works correctly with > autopkgtest > when skipping only one test. The problem appears to be something related to > parsing multiple tests to skip. I have tried a couple of syntax variations, > but so far haven’t been able to guess the right one.
You could have a look at what I've done in pydevd (soon to be removed from the archive), which was a complex case. But I'd suggest using the syntax --deselect=tests/test_file.py::test_testname instead of -k; it can be given multiple times, and as long as there are no spaces or weird characters in the test names (for example, tests/test_file.py::test_testname[this is a parameter]), it works fine when stored as a shell variable and then expanded without quotes. Best wishes, Julian