Skip to content

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

Merged
talsperre merged 2 commits into
Netflix:masterfrom
odncode:fix-duplicate-pytest-option
May 31, 2026
Merged

fix: remove duplicate --use-latest pytest option in spin conftest#3205
talsperre merged 2 commits into
Netflix:masterfrom
odncode:fix-duplicate-pytest-option

Conversation

@odncode
Copy link
Copy Markdown
Contributor

@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

This PR removes a duplicate pytest_addoption registration for --use-latest in test/unit/spin/conftest.py. The option was already registered in the parent test/unit/conftest.py (added in #3040), causing pytest to raise a ValueError during collection when running the full unit suite.

  • Deletes the redundant pytest_addoption function from test/unit/spin/conftest.py; the root-level registration already covers all subdirectories.
  • The spin conftest still consumes the option correctly via request.config.getoption("--use-latest", default=False), so no functional behavior changes.

Confidence Score: 5/5

The change is minimal and correct — removing a duplicate option registration that broke pytest collection with no effect on runtime test behavior.

The deleted code is a duplicate of an already-present registration in the parent conftest. The --use-latest option continues to be registered once and consumed correctly in the spin fixtures. No logic or behavior changes; the only effect is fixing the collection crash.

No files require special attention.

Important Files Changed

Filename Overview
test/unit/spin/conftest.py Removes duplicate pytest_addoption registration for --use-latest; the option is already registered in the parent test/unit/conftest.py and continues to be consumed correctly via request.config.getoption.

Reviews (2): Last reviewed commit: "style: fix black formatting in spin conf..." | Re-trigger Greptile

@talsperre
Copy link
Copy Markdown
Collaborator

Looks good to me. We can merge once the tests pass.

@talsperre talsperre self-requested a review May 31, 2026 04:14
talsperre
talsperre previously approved these changes May 31, 2026
Removing pytest_addoption left three blank lines before
create_flow_fixture; black collapses that to two. Fixes the
failing pre-commit check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@4871fb1). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #3205   +/-   ##
=========================================
  Coverage          ?   28.31%           
=========================================
  Files             ?      381           
  Lines             ?    52353           
  Branches          ?     9242           
=========================================
  Hits              ?    14826           
  Misses            ?    36587           
  Partials          ?      940           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@talsperre talsperre merged commit a4ea3ba into Netflix:master May 31, 2026
23 checks passed
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.

2 participants