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

tests: unit: package_managers: yarn: Fix mock assert called_once #537

Merged
merged 1 commit into from
May 13, 2024

Conversation

eskultety
Copy link
Collaborator

@eskultety eskultety commented May 6, 2024

Python 3.12 (not officially supported by cachi2) fails on the
test_main.py::test_set_yarnrc_configuration

unit tests with the following error:
AttributeError: 'called_once' is not a valid assertion. Use a spec
for the mock if 'called_once' is meant to be an attribute.

Indeed, the proper way of handling this assertion is:
mock_obj.assert_called_once()

Relates to: #536

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • [n/a] Docs updated (if applicable)
  • [n/a] Docs links in the code are still valid (if docs were updated)

Note: if the contribution is external (not from an organization member), the CI
pipeline will not run automatically. After verifying that the CI is safe to run:

@eskultety
Copy link
Collaborator Author

/retest

Python 3.12 (not officially supported by cachi2) fails on the
    test_main.py::test_set_yarnrc_configuration

unit tests with the following error:
    AttributeError: 'called_once' is not a valid assertion. Use a spec
    for the mock if 'called_once' is meant to be an attribute.

Indeed, the proper way of handling this assertion is:
    mock_obj.assert_called_once()

Signed-off-by: Erik Skultety <eskultet@redhat.com>
@eskultety eskultety added this pull request to the merge queue May 13, 2024
Merged via the queue into containerbuildsystem:main with commit 64b4e10 May 13, 2024
15 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.

None yet

4 participants