Suppress the pathfinder INFO summary on repeats, not on plugin presence - #2561
Open
LeSingh1 wants to merge 1 commit into
Open
Suppress the pathfinder INFO summary on repeats, not on plugin presence#2561LeSingh1 wants to merge 1 commit into
LeSingh1 wants to merge 1 commit into
Conversation
if hasattr(config.option, "iterations"): # pytest-freethreaded runs all tests at least twice
return
if getattr(config.option, "count", 1) > 1: # pytest-repeat
return
The comment states the intent: suppress the summary only when the run
repeats tests. The pytest-repeat line implements exactly that. The
pytest-freethreaded line checks only that the option *exists*.
--iterations is registered by the plugin with a default of 1, so merely
having pytest-freethreaded installed suppresses the summary on an ordinary
`pytest -v` run. The INFO summary is the only output of the
info_summary_append fixture, which test_load_nvidia_dynamic_lib,
test_driver_lib_loading, test_find_nvidia_headers, test_find_static_lib and
test_find_bitcode_lib use to report what they actually discovered -- so it
would silently disappear.
The plugin is not currently in cuda_pathfinder's test dependency group, so
this is dormant today, but NVIDIA#2114 moves the repo toward parallel-test plugins.
Make the check symmetric with the pytest-repeat one:
getattr(config.option, "iterations", 1) > 1.
Adds tests/test_conftest_info_summary.py, which drives the hook with stub
config/reporter objects across both plugins present/absent and
single/repeated. Two of its cases fail before this change.
Contributor
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.
The comment states the intent: suppress the summary only when the run repeats tests.
The pytest-repeat line implements exactly that (
count > 1). The pytest-freethreaded linechecks only that the option exists.
--iterationsis registered by the plugin with a default of1, so merely havingpytest-freethreaded installed suppresses the summary on an ordinary
pytest -vrun — norepetition required.
That matters because the INFO summary is the only output of the
info_summary_appendfixture, which
test_load_nvidia_dynamic_lib,test_driver_lib_loading,test_find_nvidia_headers,test_find_static_libandtest_find_bitcode_libuse toreport what they actually discovered on the host. It would silently disappear.
The plugin is not currently in
cuda_pathfinder's test dependency group(
pytest,pytest-mock,pytest-repeat,pytest-randomly), so this is dormant today —but #2114 moves the repo toward parallel-test plugins, and
pytest.inialready registersthe
thread_unsafe/parallel_threads_limitmarkers, so it is worth having right beforethat lands rather than after.
Fix
Make the check symmetric with the pytest-repeat one:
getattr(config.option, "iterations", 1) > 1.Test
New
cuda_pathfinder/tests/test_conftest_info_summary.pydrives the hook directly withstub
config/terminalreporterobjects — no plugin install and no CUDA needed — acrossthe matrix of plugin absent / present-with-1 / present-with-2 for both plugins, plus the
-vgate.Two of its cases (
freethreaded-single,both-single) fail onmain: the summary issuppressed even though nothing repeats.
Verified:
pytest cuda_pathfinder/testshas the same pass/fail set asmainotherwise;ruff check,ruff format --checkand the pre-commitmypy-pathfinderinvocation are allclean.