Skip to content

Fix doctest parametrization for pytest 9.1#5561

Merged
rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
rlratzel:2608-pytest_update_fixes
Jun 22, 2026
Merged

Fix doctest parametrization for pytest 9.1#5561
rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
rlratzel:2608-pytest_update_fixes

Conversation

@rlratzel

@rlratzel rlratzel commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Materialize the doctest generator before passing it to pytest.mark.parametrize.
  • Update the copyright year for the touched test file.

Details

Pytest 9.1 deprecated passing non-Collection iterables, such as generators and iterators, as argvalues to pytest.mark.parametrize / metafunc.parametrize.
The pytest docs recommend converting generators and iterators to a list or tuple because they can otherwise be exhausted after one collection pass.

This repo also promotes DeprecationWarning to errors in python/cugraph/pytest.ini, so the new pytest warning can fail collection in pytest 9.1.x.
The doctest set is small, so eagerly materializing it is cheap and matches pytest's documented migration path.

References:

Testing

  • git diff --check upstream/main..HEAD
  • docker exec 8cf097001d69 python -m pytest /Projects/cugraph/python/cugraph/cugraph/tests/docs/test_doctests.py --collect-only -q

Full doctest execution was also attempted in the provided container and failed due to missing local dataset files, for example karate.csv, unrelated to this collection-time change.

@rlratzel rlratzel requested a review from a team as a code owner June 22, 2026 18:10
Signed-off-by: rlratzel <rratzel@nvidia.com>
@rlratzel rlratzel force-pushed the 2608-pytest_update_fixes branch from 19d97a7 to 6945439 Compare June 22, 2026 18:18
@rlratzel rlratzel self-assigned this Jun 22, 2026
@rlratzel rlratzel added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jun 22, 2026
@alexbarghi-nv

Copy link
Copy Markdown
Member

/merge

@rapids-bot rapids-bot Bot merged commit ecfdf81 into rapidsai:main Jun 22, 2026
156 of 160 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants