Skip to content

Add test for unserializable marker arguments#14133

Closed
Vivansh27 wants to merge 2 commits intopytest-dev:mainfrom
Vivansh27:patch-1
Closed

Add test for unserializable marker arguments#14133
Vivansh27 wants to merge 2 commits intopytest-dev:mainfrom
Vivansh27:patch-1

Conversation

@Vivansh27
Copy link
Copy Markdown

This PR adds a test that documents the existing behavior when a pytest
marker receives an unsupported (unserializable) argument type.

No behavior is changed; the test simply ensures a TypeError is raised
to help prevent regressions.

Vivansh27 and others added 2 commits January 19, 2026 17:18
Update foo function to raise NotImplementedError and add test for unserializable argument.
Comment thread testing/test_mark.py


def test_marker_rejects_unserializable_argument():
with pytest.raises(TypeError):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should match the error message to be specific enough

@bluetech bluetech added the skip news used on prs to opt out of the changelog requirement label Apr 8, 2026
@bluetech
Copy link
Copy Markdown
Member

bluetech commented Apr 8, 2026

There is no such requirement AFAIK. Indeed your test actually fails...

@bluetech bluetech closed this Apr 8, 2026
@Vivansh27
Copy link
Copy Markdown
Author

There is no such requirement AFAIK. Indeed your test actually fails...

Thanks for pointing that out. My understanding was that this case should return an error.
If that's not the intended behavior, I'll modify the test. Please confirm the expected outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants