containerbuildsystem / cachi2

Cachi2 is a CLI tool that pre-fetches your project's dependencies to aid in making your build process network-isolated.
GNU General Public License v3.0
7 stars 25 forks source link

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

Closed eskultety closed 4 months ago

eskultety commented 5 months ago

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: https://github.com/containerbuildsystem/cachi2/issues/536

Maintainers will complete the following section

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 commented 5 months ago

/retest