diff --git a/changelog/13559.bugfix.rst b/changelog/13559.bugfix.rst new file mode 100644 index 00000000000..69036f784ac --- /dev/null +++ b/changelog/13559.bugfix.rst @@ -0,0 +1 @@ +Added missing `int` and `float` variants to the `Literal` type annotation of the `type` parameter in :meth:`pytest.Parser.addini`. diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 948dfe8a510..8d4ed823325 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -174,7 +174,9 @@ def addini( self, name: str, help: str, - type: Literal["string", "paths", "pathlist", "args", "linelist", "bool"] + type: Literal[ + "string", "paths", "pathlist", "args", "linelist", "bool", "int", "float" + ] | None = None, default: Any = NOT_SET, ) -> None: