You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/02/24 06:23:07 UTC

[GitHub] [airflow] uranusjr commented on pull request #21759: Rewrite taskflow-mapping argument validation

uranusjr commented on pull request #21759:
URL: https://github.com/apache/airflow/pull/21759#issuecomment-1049533181


   Hmm, this is failing with a seemingly unrelated error:
   
   ```
   _________________ TestTriggererCommand.test_capacity_argument __________________
     
     self = <tests.cli.commands.test_triggerer_command.TestTriggererCommand testMethod=test_capacity_argument>
     mock_scheduler_job = <MagicMock name='TriggererJob' id='140183951380688'>
     
         @pytest.mark.skipif(not PY37, reason="triggerer subcommand only works with Python 3.7+")
         @mock.patch("airflow.cli.commands.triggerer_command.TriggererJob")
         def test_capacity_argument(
             self,
             mock_scheduler_job,
         ):
             """Ensure that the capacity argument is passed correctly"""
             args = self.parser.parse_args(['triggerer', '--capacity=42'])
             triggerer_command.triggerer(args)
     >       mock_scheduler_job.assert_called_once_with(capacity="42")
     
     tests/cli/commands/test_triggerer_command.py:46: 
     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
     /usr/local/lib/python3.7/unittest/mock.py:889: in assert_called_once_with
         return self.assert_called_with(*args, **kwargs)
     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
     
     _mock_self = <MagicMock name='TriggererJob' id='140183951380688'>, args = ()
     kwargs = {'capacity': '42'}, expected = ((), {'capacity': '42'})
     _error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f7f1dceb050>
     actual = call(capacity=42), cause = None
     
         def assert_called_with(_mock_self, *args, **kwargs):
             """assert that the mock was called with the specified arguments.
         
             Raises an AssertionError if the args and keyword args passed in are
             different to the last call to the mock."""
             self = _mock_self
             if self.call_args is None:
                 expected = self._format_mock_call_signature(args, kwargs)
                 raise AssertionError('Expected call: %s\nNot called' % (expected,))
         
             def _error_message():
                 msg = self._format_mock_failure_message(args, kwargs)
                 return msg
             expected = self._call_matcher((args, kwargs))
             actual = self._call_matcher(self.call_args)
             if expected != actual:
                 cause = expected if isinstance(expected, Exception) else None
     >           raise AssertionError(_error_message()) from cause
     E           AssertionError: Expected call: TriggererJob(capacity='42')
     E           Actual call: TriggererJob(capacity=42)
     
     /usr/local/lib/python3.7/unittest/mock.py:878: AssertionError
   ```
   
   Investigating.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org