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 test has_calls #1898

Conversation

sfc-gh-vtimofeenko
Copy link

@sfc-gh-vtimofeenko sfc-gh-vtimofeenko commented Nov 25, 2024

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.

Changes description

Tests on python 3.12 are failing with:

$ pytest -k 'test_generate_jwt_with_passphrase'
FAILED tests/test_connection.py::test_generate_jwt_with_passphrase[pass123] - AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.
FAILED tests/test_connection.py::test_generate_jwt_with_passphrase[] - AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.

This commit fixes has_calls usage by replacing it with assert_has_calls

Tests on python 3.12 are failing with:

```
$ pytest -k 'test_generate_jwt_with_passphrase'
FAILED tests/test_connection.py::test_generate_jwt_with_passphrase[pass123] - AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.
FAILED tests/test_connection.py::test_generate_jwt_with_passphrase[] - AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.
```

This commit fixes has_calls usage by replacing it with assert_has_calls
@sfc-gh-astus
Copy link
Contributor

Merged in #1936

@sfc-gh-vtimofeenko sfc-gh-vtimofeenko deleted the fix_tests_has_calls branch December 10, 2024 17:00
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.

3 participants