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'
This commit is contained in:
Florian Bruhin 2025-07-29 10:10:13 +02:00
parent b9aec6777a
commit f2ec540a1b
1 changed files with 1 additions and 1 deletions

View File

@ -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"}