Skip to content

docs(tests): the snapshot command names no syrupy option #5146

Open

Description

@dan-petty

Problem Description

docs/TESTING.md (the syrupy rule, line 125) says to regenerate a snapshot with uv run pytest <test-file> --snapshot-update --snapshot-file-lock, and says that the file lock is required. The pinned syrupy 7.0.0 has no option --snapshot-file-lock, so the documented command stops with a usage error. syrupy 7.0.0 locks an amber snapshot file by itself when pytest-xdist distributes work, and has only --snapshot-file-lock-timeout (default 60 seconds).

Reproduction Steps

  1. uv run pytest tests/ai/mcp/test_mcp_tool_listing.py --snapshot-update --snapshot-file-lock

Expected vs Actual Behavior

Expected: the documented command updates the snapshot.

Actual: pytest: error: unrecognized arguments: --snapshot-file-lock. uv run pytest <test-file> --snapshot-update works, and syrupy takes the lock under xdist by itself (syrupy/__init__.py, option --snapshot-file-lock-timeout: "Locking is enabled automatically when xdist is distributing work").

Environment Diagnostics

devops-cli at origin/main on 2026-11-12, syrupy 7.0.0 from uv.lock, Python 3.14.

Logs, Traces, or Terminal Output

pytest: error: unrecognized arguments: --snapshot-file-lock
  inifile: pyproject.toml

Found while updating the MCP tool listing snapshot for pull request #5142.

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Alternatives check of 2026-11-16: not-applicable.
Class: docs, no search.
Tool: none found.

Proposed design

Problem statement

docs/TESTING.md tells a maintainer to regenerate a snapshot with uv run pytest <test-file> --snapshot-update --snapshot-file-lock. The same text says that the file lock is required. syrupy 7.0.0 and 7.0.3 have no option --snapshot-file-lock, so the command stops with pytest: error: unrecognized arguments: --snapshot-file-lock. A maintainer who updates a snapshot needs a command that works. The guide must show that command and must state the automatic lock.

Acceptance criteria

Requirement: The snapshot command names no lock option

The testing guide SHALL name no --snapshot-file-lock option in its snapshot update command.

Scenario: The removed option is absent

  • WHEN A maintainer runs ! git grep -n -F -e 'snapshot-file-lock' -- docs/TESTING.md.
  • THEN The command exits 0 and prints no line.

Requirement: The guide drops the false lock requirement

The testing guide SHALL NOT claim that an explicit file lock is required for a snapshot update.

Scenario: The old lock sentence is absent

  • WHEN A maintainer runs ! git grep -n -F -e 'The file lock is required' -- docs/TESTING.md.
  • THEN The command exits 0 and prints no line.

Requirement: The guide names the automatic lock

The testing guide SHALL state that syrupy locks the amber snapshot file by itself when pytest-xdist distributes work.

Scenario: The automatic lock sentence is present

  • WHEN A maintainer runs git grep -n -F -e 'locks the amber snapshot file by itself when pytest-xdist distributes work' -- docs/TESTING.md.
  • THEN The command exits 0 and prints the line of the guide that holds the sentence.

Requirement: The testing guide passes the docs check

The testing guide MUST pass the repository docs check after the snapshot command changes.

Scenario: The docs check passes

  • WHEN A maintainer runs uv run devops ci docs.
  • THEN The command exits 0 and reports no docs error.

Existing Tool Considered

The alternatives check of 2026-11-16 in the issue body returned not-applicable for this docs item, made no search, and named no tool. The library in play is syrupy, which uv.lock pins. syrupy covers the snapshot update need. It lacks an option --snapshot-file-lock, because it locks the amber snapshot file by itself when pytest-xdist distributes work. The change writes no code and builds nothing, so it has no build cost.

Key questions

  • Which command does docs/TESTING.md show to regenerate a snapshot with syrupy 7.x?: Show uv run pytest <test-file> --snapshot-update and no lock option. syrupy locks the amber snapshot file by itself when pytest-xdist distributes work, so the update keeps its entries. (best practice) [sources: docs/TESTING.md, uv.lock, pyproject.toml]
    • Chosen: Use --snapshot-update alone. syrupy 7.0.3 locks the amber file by itself under pytest-xdist, so the command runs and keeps the entries.
    • Rejected: Keep --snapshot-file-lock. syrupy 7.0.0 and 7.0.3 have no such option, so pytest stops with unrecognized arguments.
    • Rejected: Name --snapshot-file-lock-timeout in the guide. The automatic lock needs no option. A timeout is a rare case.
  • Does this documentation fix need a new test?: No. A document gets no test. The proof is a command that runs again with the same answer: the ! git grep checks and uv run devops ci docs. [sources: docs/TESTING.md]
  • What does the guide do with the old sentence that cites syrupy issue 1237?: The guide drops that sentence with its citation. The new sentence states the automatic lock, so the guide needs no citation of the old problem. (best practice) [sources: docs/TESTING.md]
    • Chosen: Drop the sentence with its citation. The sentence makes the false claim that the file lock is required.
    • Rejected: Keep the citation and change the claim. The citation then points at a problem that syrupy already fixes.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/docs
    scope/tests
    status/new
    value/medium
    effort/low
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Seen again on 2026-11-12 while I wrote the snapshot of #5189: uv run pytest <file> --snapshot-update --snapshot-file-lock stops with "unrecognized arguments: --snapshot-file-lock" (pytest 9.2.0, syrupy 7.0.0). pytest --help lists no lock option. I ran --snapshot-update -n 0 in place of it.

  5. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    The issue occurred again on 2026-11-13 in #5297 (#5212). Issue #5212 told the agent to run uv run pytest tests/ai/mcp/test_mcp_tool_listing.py --snapshot-update --snapshot-file-lock, as docs/TESTING.md says. The command stopped with pytest: error: unrecognized arguments: --snapshot-file-lock. uv run pytest -q -n 0 tests/ai/mcp/test_mcp_tool_listing.py --snapshot-update updated the snapshot.

  6. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: docs. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.

  7. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor

    Seen again on 2026-11-16 in #5975: uv run pytest tests/roadmap/test_job_grade_report.py --snapshot-update --snapshot-file-lock stops with unrecognized arguments: --snapshot-file-lock (syrupy 7.0.0). The command with --snapshot-update and -n 0 updated the snapshot.

  8. added
    status/ready
    and removed
    status/new
    on Nov 17, 2026
  9. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at c58b592 (see proposed design in issue body).

  10. dan-petty commented on Nov 25, 2026

    @dan-petty
    OwnerAuthor

    The defect is still present on 2026-11-25 with syrupy 7.0.3: uv run pytest tests/roadmap/implement/test_roadmap_implement_step.py --snapshot-update --snapshot-file-lock stops with pytest: error: unrecognized arguments: --snapshot-file-lock (worktree of #7217). The update worked with --snapshot-update -n 0. I filed #7225 for it by mistake and closed it as a duplicate of this item.

  11. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  12. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor

    Seen again on 2026-11-28 at origin/main 70dc18c, with syrupy 7.0.3 (pyproject.toml): uv run pytest tests/ai/mcp/test_mcp_tool_listing.py --snapshot-update --snapshot-file-lock -q stops with pytest: error: unrecognized arguments: --snapshot-file-lock. docs/TESTING.md (Test data) still requires the option. The same command with no --snapshot-file-lock updated the snapshot.

  13. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/testssource/agentstatus/readytype/docsvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions