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] AssertionError: Expected 'print' to be called once. Called 7551 times. #7140

Closed
drew2a opened this issue Nov 2, 2022 · 0 comments · Fixed by #7156
Closed

[Tests] AssertionError: Expected 'print' to be called once. Called 7551 times. #7140

drew2a opened this issue Nov 2, 2022 · 0 comments · Fixed by #7156

Comments

@drew2a
Copy link
Contributor

drew2a commented Nov 2, 2022

https://github.com/Tribler/tribler/actions/runs/3379038407/jobs/5610070695#step:4:256 in #7139

src/tribler/core/logger/tests/test_logger.py F

=================================== FAILURES ===================================
_________________________ test_setup_logging_exception _________________________

__wrapped_mock_method__ = <function NonCallableMock.assert_called_once_with at 0x7f2518bbb9d0>
args = (<MagicMock name='print' id='139796884481792'>, 'Error in loading logger config. Using default configs. ', 'ZeroDivisionError: ')
kwargs = {'file': <MagicMock name='stderr' id='139796840503808'>}
__tracebackhide__ = True
msg = "Expected 'print' to be called once. Called 7551 times.\nCalls: [call('Traceback (most recent call last):\\n', file=<M...logger config. Using default configs. ', 'ZeroDivisionError: ', file=<MagicMock name='stderr' id='139796840503808'>)]."
__mock_self = <MagicMock name='print' id='139796884481792'>
actual_args = ('Error in loading logger config. Using default configs. ', 'ZeroDivisionError: ')
actual_kwargs = {'file': <MagicMock name='stderr' id='139796840503808'>}
introspection = '', @py_assert2 = None, @py_assert1 = None

    def assert_wrapper(
        __wrapped_mock_method__: Callable[..., Any], *args: Any, **kwargs: Any
    ) -> None:
        __tracebackhide__ = True
        try:
>           __wrapped_mock_method__(*args, **kwargs)


../../../.virtualenvs/.venv/lib/python3.8/site-packages/pytest_mock/plugin.py:414: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='print' id='139796884481792'>
args = ('Error in loading logger config. Using default configs. ', 'ZeroDivisionError: ')
kwargs = {'file': <MagicMock name='stderr' id='139796840503808'>}
msg = "Expected 'print' to be called once. Called 7551 times.\nCalls: [call('Traceback (most recent call last):\\n', file=<M...logger config. Using default configs. ', 'ZeroDivisionError: ', file=<MagicMock name='stderr' id='139796840503808'>)]."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'print' to be called once. Called 7551 times.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant