On Thu, Feb 26, 2026 at 04:33:58PM -0500, John Snow wrote: > Following suit with the rest of this repository, drop avocado and > replace it with the Python standard "pytest" package. > > Our ultimate goal is to merge these python tests with the meson test > suite, so the use of 'pytest' here is only a stop-gap solution to get > the GitLab CI 'check-python-tox' passing again following recent Python > packaging ecosystem changes. > > Signed-off-by: John Snow <[email protected]> > --- > python/Makefile | 4 +- > python/setup.cfg | 1 + > python/tests/linters.py | 79 ++++++++++++++++++++++++++++++++++++++++ > python/tests/minreqs.txt | 1 + > 4 files changed, 83 insertions(+), 2 deletions(-) > create mode 100644 python/tests/linters.py
Reviewed-by: Daniel P. Berrangé <[email protected]> > +class TestLinters: > + > + def test_flake8_pkg(self): > + check_call([sys.executable, "-m", "flake8", "qemu/"]) > + > + def test_flake8_scripts(self): > + check_call([sys.executable, "-m", "flake8", "scripts/"]) > + > + def test_flake8_qapi(self): > + check_call([sys.executable, "-m", "flake8", > + "../scripts/qapi/", > + "../docs/sphinx/qapidoc.py", > + "../docs/sphinx/qapi_domain.py"]) Underindented. > + > + def test_isort_pkg(self): > + check_call([sys.executable, "-m", "isort", "-c", "qemu/"]) > + > + def test_isort_scripts(self): > + check_call([sys.executable, "-m", "isort", "-c", "scripts/"]) > + > + def test_isort_qapi(self): > + check_call([sys.executable, "-m", "isort", > + "--sp", ".", "-c", "../scripts/qapi/"]) > + > + def test_isort_qapi_sphinx(self): > + # Force isort to recognize 'compat' as a local module and not > + # third-party > + check_call([sys.executable, "-m", "isort", > + "--sp", ".", "-c", "-p", "compat", > + "../docs/sphinx/qapi_domain.py", > + "../docs/sphinx/qapidoc.py"]) > + ... > + > + def test_pylint_qapi(self): > + os.environ['SETUPTOOLS_USE_DISTUTILS'] = 'stdlib' > + check_call([sys.executable, "-m", "pylint", > + "--rcfile=../scripts/qapi/pylintrc", > + "../scripts/qapi/", > + "../docs/sphinx/qapidoc.py", > + "../docs/sphinx/qapi_domain.py"]) Underindented. > + > + def test_pylint_iotests(self): > + os.environ['SETUPTOOLS_USE_DISTUTILS'] = 'stdlib' > + check_call([sys.executable, "-m", "linters", "--pylint"], > + cwd="../tests/qemu-iotests/") With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
