Skip to content

fix: remove duplicate --use-latest pytest option in spin conftest#3205

Open
odncode wants to merge 1 commit into
Netflix:masterfrom
odncode:fix-duplicate-pytest-option
Open

fix: remove duplicate --use-latest pytest option in spin conftest#3205
odncode wants to merge 1 commit into
Netflix:masterfrom
odncode:fix-duplicate-pytest-option

Conversation

@odncode
Copy link
Copy Markdown

@odncode odncode commented May 20, 2026

Summary

Remove duplicate --use-latest pytest option registration that prevents the unit test suite from collecting.

Problem

Running pytest test/unit/ fails during collection with:

ValueError: option names {'--use-latest'} already added

--use-latest is registered in both test/unit/conftest.py (added in #3040) and test/unit/spin/conftest.py (from #2506). pytest raises on the duplicate.

Fix

Remove pytest_addoption from test/unit/spin/conftest.py. The root test/unit/conftest.py already registers the option and it applies to all subdirectories.

Testing

State Result
Before pytest test/unit/ fails with collection error
After 468 passed, 1 failed, 19 skipped, 21 errors

Note: The 1 failure (complex_dag) and 21 errors (secrets/system_context tests) are pre-existing infrastructure issues unrelated to this change.

test/unit/conftest.py (added in Netflix#3040) already registers the --use-latest
option for all unit tests. The duplicate registration in
test/unit/spin/conftest.py (from Netflix#2506) causes a ValueError during test
collection, preventing the entire unit test suite from running:

    ValueError: option names {'--use-latest'} already added

Fix: remove the duplicate pytest_addoption from spin/conftest.py.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 20, 2026

Greptile Summary

Removes a duplicate pytest_addoption hook from test/unit/spin/conftest.py that re-registered --use-latest, causing pytest collection to abort with a ValueError when running the full test/unit/ suite.

  • The root test/unit/conftest.py (added in Testing Infra Enhancements #3040) already registers --use-latest and pytest propagates it to all subdirectories, making the spin-level registration redundant and conflicting.
  • spin/conftest.py still calls request.config.getoption(\"--use-latest\", default=False) as before, which continues to work because the option is now registered exactly once at the correct scope.

Confidence Score: 5/5

Safe to merge — removes a single duplicate option registration that was breaking test collection; no logic changes.

The change is a one-hunk deletion of eight lines. The root conftest already owns the --use-latest registration, and the spin fixtures continue to consume it via request.config.getoption without any modification.

No files require special attention.

Important Files Changed

Filename Overview
test/unit/spin/conftest.py Removes duplicate pytest_addoption that registered --use-latest twice; the root test/unit/conftest.py already owns the registration, so spin tests pick it up automatically.

Reviews (1): Last reviewed commit: "fix: remove duplicate --use-latest pytes..." | Re-trigger Greptile

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant