Repository navigation
fix: accept documented disable_debugger_detection kwarg in timeout marker - #216
Merged
flub merged 1 commit intoOct 31, 2026
Conversation
…rker The timeout marker registration (and the --markers help text) documents a disable_debugger_detection keyword, but _parse_marker() rejected it with 'TypeError: Invalid keyword argument for timeout marker', turning any test using @pytest.mark.timeout(..., disable_debugger_detection=True) into an INTERNALERROR at collection/run time. Parse the keyword (keyword-only, consistent with the documented marker signature) and pass it through so the existing per-marker validation in _get_item_settings() applies to it like the other keyword arguments. Co-authored-by: rahul05ranjan <11793455+rahul05ranjan@users.noreply.github.com>
flub
approved these changes
Oct 31, 2026
flub
left a comment
Member
There was a problem hiding this comment.
I'd appreciate if you do not let LLMs write the text of issues. It's really hard to read. Please put in the effort to communicate in your own words.
Member
|
Please read the commit message, this needed only two lines of explanation to communicate clearly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #215.
Problem
The
timeoutmarker registration documents adisable_debugger_detectionkeyword (it also appears inpytest --markersoutput), but_parse_marker()has no branch for it, so:kills the whole session with
INTERNALERROR> TypeError: Invalid keyword argument for timeout marker: disable_debugger_detection.The CLI flag and ini setting of the same name work; only the documented marker keyword is broken.
Fix
Parse
disable_debugger_detectionin_parse_marker()as a keyword-only argument and include it in the returnedSettings, so the existing_validate_disable_debugger_detection()validation in_get_item_settings()applies to it like the other keyword arguments. Unknown keywords are still rejected.Verification
INTERNALERRORabove; after the fix the test passes.test_timeout_marker_disable_debugger_detection_keywordcovers the keyword both alone and combined withmethod/func_onlyviapytester.runpytest_subprocess()._parse_marker(pytest.mark.timeout(60, disable_debugger_detection=True))now returnsSettings(timeout=60, method=None, func_only=None, disable_debugger_detection=True), whilepytest.mark.timeout(10, bogus=True)is still rejected withTypeError.parser.addini(..., type="float")requires pytest >= 8.4, and my system pytest is 8.3.5, so I could not run the full suite locally as-is; I verified the end-to-end behavior with a local one-lineaddinishim (coercing the new"float"ini type, unrelated to this change) on top of this patch. The new pytester test runs in the project's normal CI matrix.