Skip to content

test(e2e): add pytest-mock regression test#876

Merged
arrdem merged 1 commit intomainfrom
arrdem/repro-530
Mar 20, 2026
Merged

test(e2e): add pytest-mock regression test#876
arrdem merged 1 commit intomainfrom
arrdem/repro-530

Conversation

@arrdem
Copy link
Copy Markdown
Contributor

@arrdem arrdem commented Mar 20, 2026

pytest-mock works correctly with both py_test (using pytest_main=True) and py_venv_test on current main. The original issue was likely a configuration problem — either using @pypi//pytest-mock (hyphen, doesn't exist) instead of @pypi//pytest_mock (underscore), or not including pytest-mock in the project's pyproject.toml dependencies.

This adds an e2e regression test to make sure it stays working.

Closes #530

Changes are visible to end-users: no

Test plan

  • New test cases added
  • Both bazel test //cases/pytest-mock-530:test_mock_py_test and bazel test //cases/pytest-mock-530:test_mock_py_venv_test pass, exercising the mocker fixture, mocker.spy, and MagicMock

Adds an e2e test case exercising pytest-mock with both py_test
(pytest_main=True) and py_venv_test. Confirms the mocker fixture,
mocker.spy, and MagicMock all work correctly.

Closes #530

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@arrdem arrdem changed the title test(e2e): add pytest-mock regression test (closes #530) test(e2e): add pytest-mock regression test Mar 20, 2026
@arrdem arrdem merged commit 5fff920 into main Mar 20, 2026
3 checks passed
@arrdem arrdem deleted the arrdem/repro-530 branch March 20, 2026 06:17
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.

[FR]: py_pytest with mock

1 participant