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:
parent
b9aec6777a
commit
f2ec540a1b
|
|
@ -442,7 +442,7 @@ class TestArgument:
|
||||||
def test_no_docstring_with_optimize(self, monkeypatch):
|
def test_no_docstring_with_optimize(self, monkeypatch):
|
||||||
"""With -OO we'd get a warning on start, but no warning afterwards."""
|
"""With -OO we'd get a warning on start, but no warning afterwards."""
|
||||||
sys_flags_fake = types.SimpleNamespace(
|
sys_flags_fake = types.SimpleNamespace(
|
||||||
{
|
**{
|
||||||
k: v
|
k: v
|
||||||
for k, v in inspect.getmembers(sys.flags)
|
for k, v in inspect.getmembers(sys.flags)
|
||||||
if not k.startswith("_") and k not in {"count", "index"}
|
if not k.startswith("_") and k not in {"count", "index"}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue