From f2ec540a1b11451e3eb03eac27032e4ce1300855 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 29 Jul 2025 10:10:13 +0200 Subject: [PATCH] tests: Fix sys.flags workaround with older Python versions types.SimpleNamespace only accepts a positional argument with Python 3.13: 'https://docs.python.org/3/whatsnew/3.13.html#types' --- tests/unit/api/test_cmdutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/api/test_cmdutils.py b/tests/unit/api/test_cmdutils.py index 61c9534b5..79bacb15e 100644 --- a/tests/unit/api/test_cmdutils.py +++ b/tests/unit/api/test_cmdutils.py @@ -442,7 +442,7 @@ class TestArgument: def test_no_docstring_with_optimize(self, monkeypatch): """With -OO we'd get a warning on start, but no warning afterwards.""" sys_flags_fake = types.SimpleNamespace( - { + **{ k: v for k, v in inspect.getmembers(sys.flags) if not k.startswith("_") and k not in {"count", "index"}