Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Use pytest-mock in tests (#847)
* Add pytest-mock to requirements * chore: Replace usages of monkeypatch in test_unit.py * Replace usages of `mock_function` in test_unit.py with `mocker.patch` * Simplify raising exceptions * Prefeer `mocker.patch` over `mocker.patch.object` * Use mocker.stub() for mocking callbacks * chore: Use pytest-mock in client tests (#848) * chore: Replaces usages of monkeypatch in test_client.py * Attempt to use mocker and reset os.remove (#850) * Attempt to use mocker and reset os.remove * Use mocker.resetall to reset all mocks * Use stop (reset is just for the mock call values) * Fix types: use mocker.stop on remove_mock --------- Co-authored-by: Trey Hunner <[email protected]> * Chore/use pytest mock for integration tests (#849) * Replace some monkeypatch uses with pytest-mock * Use mocker everywhere in integration tests Replace all uses of unittest.mock, monkeypatch fixture, and the custom mock_function fixture with the mocker fixture from pytest-mock. * Use mocker for mock_function fixture * Use non-string type annotations for Mock * Prefer mocker.patch over mocker.patch.object * Apply suggestions from code review Co-authored-by: Jakub Fidler <[email protected]> * Fix variable name typos (mesaage -> message) * Remove unused mock_function fixture --------- Co-authored-by: Jakub Fidler <[email protected]> --------- Co-authored-by: Trey Hunner <[email protected]>
- Loading branch information