Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: image: fix incorrect assertion test
Python v3.12 and later raise an exception for this line with the following message: """ AttributeError: 'called_once_with' is not a valid assertion. Use a spec for the mock if 'called_once_with' is meant to be an attribute.. Did you mean: 'assert_called_once_with'? """ A bit of research returned commit 1d4d677d1c90 ("gh-100690: Raise an AttributeError when the assert_ prefix is forgotten when using Mock (#100691)") from CPython git history, which in turns points at python/cpython#100690. This GitHub issue mentions that called_once_with returns a Mock object instead of doing a proper assertion. This test is basically a no-op. Therefore, let's fix the test by doing a proper assertion. Fixes: 94d64c8 ("test: image: improve code coverage by testing BaseImage") Signed-off-by: Quentin Schulz <[email protected]>
- Loading branch information