-
=========================================================================== FAILURES =========================================================================== _________________________________________________________ ParallelTest.test_parallel_captures_logging __________________________________________________________ self = <tests.test_commands.ParallelTest testMethod=test_parallel_captures_logging>, mock_log = <MagicMock name='log' id='4373928720'> @mock.patch('quibble.commands.log') def test_parallel_captures_logging(self, mock_log): quibble.commands.Parallel( steps=[ EchoCommand(number=1), EchoCommand(number=2), EchoCommand(number=3), ] ).execute() print(mock_log.info.mock_calls) # TODO: # * assert that log level filters are inherited from parent process. > mock_log.info.assert_any_call( "log line\nstdout line\nstderr line\nI am 1.\n" ) tests/test_commands.py:666: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <MagicMock name='log.info' id='4375283504'>, args = ('log line\nstdout line\nstderr line\nI am 1.\n',), kwargs = {} expected = call('log line\nstdout line\nstderr line\nI am 1.\n'), cause = None actual = [call('log line\nstderr line\n'), call('log line\nstderr line\n'), call('log line\nstderr line\n')] expected_string = "info('log line\\nstdout line\\nstderr line\\nI am 1.\\n')" def assert_any_call(self, /, *args, **kwargs): """assert the mock has been called with the specified arguments. The assert passes if the mock has *ever* been called, unlike `assert_called_with` and `assert_called_once_with` that only pass if the call is the most recent one.""" expected = self._call_matcher(_Call((args, kwargs), two=True)) cause = expected if isinstance(expected, Exception) else None actual = [self._call_matcher(c) for c in self.call_args_list] if cause or expected not in _AnyComparer(actual): expected_string = self._format_mock_call_signature(args, kwargs) > raise AssertionError( '%s call not found' % expected_string ) from cause E AssertionError: info('log line\nstdout line\nstderr line\nI am 1.\n') call not found /opt/homebrew/Cellar/python@3.10/3.10.1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/mock.py:990: AssertionError --------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------- [call('log line\nstderr line\n'), call('log line\nstderr line\n'), call('log line\nstderr line\n')] =================================================================== short test summary info ==================================================================== FAILED tests/test_commands.py::ParallelTest::test_parallel_captures_logging - AssertionError: info('log line\nstdout line\nstderr line\nI am 1.\n') call not ... ========================================================= 1 failed, 143 passed, 4 deselected in 2.59s ========================================================== ERROR: InvocationError for command /Users/kostajh/src/integration/quibble/.tox/venv-py3/bin/pytest -m 'not integration' (exited with code 1)
Please register or sign in to comment