From 466318ce3603ca592cc956dea1b593a873b8df71 Mon Sep 17 00:00:00 2001 From: NayeemJohn <44828643+NayeemJohnY@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:05:03 +0530 Subject: [PATCH 1/7] Added "int" & "float" to the argparsing type Literal --- src/_pytest/config/argparsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 948dfe8a510..8d04b58368b 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -174,7 +174,7 @@ 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: From 17a055b84837d5789e74b0a00486bc0702ab40b5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 06:38:41 +0000 Subject: [PATCH 2/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/config/argparsing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 8d04b58368b..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", "int", "float"] + type: Literal[ + "string", "paths", "pathlist", "args", "linelist", "bool", "int", "float" + ] | None = None, default: Any = NOT_SET, ) -> None: From b5459ac8fb11db1d20715d2e8bd5ae0117d47568 Mon Sep 17 00:00:00 2001 From: NayeemJohn <44828643+NayeemJohnY@users.noreply.github.com> Date: Tue, 24 Jun 2025 17:35:01 +0530 Subject: [PATCH 3/7] Changelog 13559 valid type literal update --- changelog/13559.bugfix.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/13559.bugfix.rst diff --git a/changelog/13559.bugfix.rst b/changelog/13559.bugfix.rst new file mode 100644 index 00000000000..c119beccf6b --- /dev/null +++ b/changelog/13559.bugfix.rst @@ -0,0 +1,3 @@ +In [argpasring.py](https://github.com/pytest-dev/pytest/commit/d126389308eb787efa0c0ebffc566a5bb1619e4d#diff-fba659a65c3f48c4b1aa922c07dddb92d10c059c84eb383b1ae16197987463b5R177) supported type "int" and "float" are not added. So type checker tools shows error. + +Fixed by adding "int" and "float" as valid type literal From 29a7cac38701306578b561d5bfade0ac6f38a11f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 24 Jun 2025 13:26:06 -0300 Subject: [PATCH 4/7] Update and rename 13559.bugfix.rst to 13559.trivial.rst --- changelog/13559.bugfix.rst | 3 --- changelog/13559.trivial.rst | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 changelog/13559.bugfix.rst create mode 100644 changelog/13559.trivial.rst diff --git a/changelog/13559.bugfix.rst b/changelog/13559.bugfix.rst deleted file mode 100644 index c119beccf6b..00000000000 --- a/changelog/13559.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -In [argpasring.py](https://github.com/pytest-dev/pytest/commit/d126389308eb787efa0c0ebffc566a5bb1619e4d#diff-fba659a65c3f48c4b1aa922c07dddb92d10c059c84eb383b1ae16197987463b5R177) supported type "int" and "float" are not added. So type checker tools shows error. - -Fixed by adding "int" and "float" as valid type literal diff --git a/changelog/13559.trivial.rst b/changelog/13559.trivial.rst new file mode 100644 index 00000000000..da020b97889 --- /dev/null +++ b/changelog/13559.trivial.rst @@ -0,0 +1 @@ +Add missing `"int"` and `"float"` variants to the `Literal` type annotation of the `type` parameter of :meth:`pytest.Parser.addini`. From 654964b6863e25adaec4b6fef6346ddb113c3cd9 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 24 Jun 2025 13:27:42 -0300 Subject: [PATCH 5/7] Update 13559.trivial.rst --- changelog/13559.trivial.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/13559.trivial.rst b/changelog/13559.trivial.rst index da020b97889..73169c63163 100644 --- a/changelog/13559.trivial.rst +++ b/changelog/13559.trivial.rst @@ -1 +1 @@ -Add missing `"int"` and `"float"` variants to the `Literal` type annotation of the `type` parameter of :meth:`pytest.Parser.addini`. +Add missing `int` and `float` variants to the `Literal` type annotation of the `type` parameter in :meth:`pytest.Parser.addini`. From 7192e2f63281cdc30cd3d4897947e91f6e48adee Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 24 Jun 2025 13:29:18 -0300 Subject: [PATCH 6/7] Rename 13559.trivial.rst to 13559.bugfix.rst --- changelog/{13559.trivial.rst => 13559.bugfix.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{13559.trivial.rst => 13559.bugfix.rst} (100%) diff --git a/changelog/13559.trivial.rst b/changelog/13559.bugfix.rst similarity index 100% rename from changelog/13559.trivial.rst rename to changelog/13559.bugfix.rst From a1246def593b894ad7513909b4045c187f9bd2d0 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 24 Jun 2025 13:32:48 -0300 Subject: [PATCH 7/7] Update 13559.bugfix.rst --- changelog/13559.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/13559.bugfix.rst b/changelog/13559.bugfix.rst index 73169c63163..69036f784ac 100644 --- a/changelog/13559.bugfix.rst +++ b/changelog/13559.bugfix.rst @@ -1 +1 @@ -Add missing `int` and `float` variants to the `Literal` type annotation of the `type` parameter in :meth:`pytest.Parser.addini`. +Added missing `int` and `float` variants to the `Literal` type annotation of the `type` parameter in :meth:`pytest.Parser.addini`.