From 614592549d5f384d703caed91bb6d0eaea6da940 Mon Sep 17 00:00:00 2001 From: Vivansh Vanethiya Date: Mon, 19 Jan 2026 17:18:36 +0530 Subject: [PATCH 1/2] Add test for unserializable marker arguments Update foo function to raise NotImplementedError and add test for unserializable argument. --- testing/test_mark.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testing/test_mark.py b/testing/test_mark.py index 67219313183..724fc3233da 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1343,4 +1343,10 @@ def test_fixture_disallowed_between_marks() -> None: @pytest.fixture @pytest.mark.usefixtures("tmp_path") def foo(): - raise NotImplementedError() + raise NotImplementedError() + +def test_marker_rejects_unserializable_argument(): + with pytest.raises(TypeError): + @pytest.mark.example(object()) + def test_func(): + pass From 4e27630f03d1b9ff69756ddf2031191b05f45d66 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 11:51:42 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- testing/test_mark.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/test_mark.py b/testing/test_mark.py index 724fc3233da..075018f3e32 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1343,10 +1343,12 @@ def test_fixture_disallowed_between_marks() -> None: @pytest.fixture @pytest.mark.usefixtures("tmp_path") def foo(): - raise NotImplementedError() + raise NotImplementedError() + def test_marker_rejects_unserializable_argument(): with pytest.raises(TypeError): + @pytest.mark.example(object()) def test_func(): pass