Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect Python tests using mock.called_with #8715

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

chosak
Copy link
Member

@chosak chosak commented Jan 13, 2025

This followup to #8711 fixes various Python tests that are incorrectly trying to call called_with on a mock object, when the correct call is assert_called_with.

Most of these tests are in the Paying for College disclosures code, and one is in iRegulations.

Currently these tests don't actually test anything, as assertTrue(something that is truthy) does nothing.

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code follows the standards laid out in the CFPB development guidelines

This followup to PR 8711 fixes various Python tests that are incorrectly
trying to call `called_with` on a mock object, when the correct call is
`assert_called_with` [0].

Most of these tests are in the Paying for College disclosures code, and
one is in iRegulations.

Currently these tests don't actually test anything, as
`assertTrue(something that is truthy)` does nothing.

[0] https://docs.python.org/3.8/library/unittest.mock.html#unittest.mock.Mock.assert_called_with
@chosak chosak mentioned this pull request Jan 13, 2025
12 tasks
@chosak chosak added this pull request to the merge queue Jan 13, 2025
Merged via the queue into main with commit e2f151a Jan 13, 2025
12 checks passed
@chosak chosak deleted the fix/mock-called-with-tests branch January 13, 2025 19:02
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