Skip to contentSkip to conversation

python: testing fixes

PATCH In review John Snow 2 participants 6 messages Dec 3, 2022 – Jan 4, 2023

lore
Share & tools
lore

John Snow

author
#0 lore raw

cover python: testing fixes

A few tiny touchups needed for cutting edge 'flake8' tooling, a minor type touchup in iotests, and extending the python tests to cover the recently released Python 3.11.

John Snow (3):
Python: fix flake8 config
iotests/check: Fix typing for sys.exit() value
python: add 3.11 to supported list

 python/setup.cfg         | 6 ++++--
 tests/qemu-iotests/check | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.38.1
author
#1 lore raw

PATCH 1/3 Python: fix flake8 config

Newer flake8 versions are a bit pickier about the config file, and my in-line comment confuses the parser. Fix it.

---
 python/setup.cfg | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
python/setup.cfg +2 -1
index c2c61c75190..c0d7bab168e 100644
@@ -71,7 +71,8 @@ console_scripts =
     qmp-tui = qemu.qmp.qmp_tui:main [tui]
 
 [flake8]
-extend-ignore = E722  # Prefer pylint's bare-except checks to flake8's
+# Prefer pylint's bare-except checks to flake8's
+extend-ignore = E722
 exclude = __pycache__,
 
 [mypy]
Signature · 1 line
2.38.1
author
#2 lore raw

PATCH 2/3 iotests/check: Fix typing for sys.exit() value

In reply to John Snow
---
 tests/qemu-iotests/check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/check +1 -1
index 75de1b4691e..9bdda1394e7 100755
@@ -159,7 +159,7 @@ if __name__ == '__main__':
         if not tests:
             raise ValueError('No tests selected')
     except ValueError as e:
-        sys.exit(e)
+        sys.exit(str(e))
 
     if args.dry_run:
         print('\n'.join(tests))
Signature · 1 line
2.38.1
author
#3 lore raw

PATCH 3/3 python: add 3.11 to supported list

In reply to John Snow
---
 python/setup.cfg | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
python/setup.cfg +2 -1
index c0d7bab168e..56418157065 100644
@@ -19,6 +19,7 @@ classifiers =
     Programming Language :: Python :: 3.8
     Programming Language :: Python :: 3.9
     Programming Language :: Python :: 3.10
+    Programming Language :: Python :: 3.11
     Typing :: Typed
 
 [options]
@@ -159,7 +160,7 @@ multi_line_output=3
 # of python available on your system to run this test.
 
 [tox:tox]
-envlist = py36, py37, py38, py39, py310
+envlist = py36, py37, py38, py39, py310, py311
 skip_missing_interpreters = true
 
 [testenv]
Signature · 1 line
2.38.1
Reviewed-by on the v1 series
#4 lore raw
In reply to John Snow
Quoted 4 lines · John Snow

A few tiny touchups needed for cutting edge 'flake8' tooling, a minor type touchup in iotests, and extending the python tests to cover the recently released Python 3.11.

Quoted 12 lines

John Snow (3):
  Python: fix flake8 config
  iotests/check: Fix typing for sys.exit() value
  python: add 3.11 to supported list

 python/setup.cfg         | 6 ++++--
 tests/qemu-iotests/check | 2 +-

 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.38.1

I see you've left Westeros! xD

Quoted 2 lines
author
#5 lore raw
Quoted 11 lines · Wilfred Mallawa
Quoted 9 lines · John Snow

A few tiny touchups needed for cutting edge 'flake8' tooling, a minor type touchup in iotests, and extending the python tests to cover the recently released Python 3.11.

John Snow (3):
Python: fix flake8 config
iotests/check: Fix typing for sys.exit() value
python: add 3.11 to supported list

Quoted 8 lines
Quoted 7 lines
 python/setup.cfg         | 6 ++++--
 tests/qemu-iotests/check | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

--
2.38.1

I see you've left Westeros! xD

I'm not a huge fan of these ...

Quoted 2 lines

... but thank you for the review.

--js