Uploaded image for project: 'Aurora'
  1. Aurora
  2. AURORA-938

TestVersionCommand::test_version_with_new_pants fails under py.test

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.7.0
    • Client, Testing
    • None
    • Twitter Aurora Q4 Sprint 4

    Description

      Command run:

      (pycharm.venv)~aurora git aurora/. kts/shallow-copy    
      % PYTHONPATH=src/main/python py.test src/test/python -vx
      ...
      ___________________________ TestVersionCommand.test_version_with_new_pants ____________________________
      
      args = (<client.commands.test_version.TestVersionCommand testMethod=test_version_with_new_pants>, <PropertyMock name='build_properties' id='139965496085648'>, <MagicMock name='print' id='139964006033616'>)
      keywargs = {}
      extra_args = [<PropertyMock name='build_properties' id='139965496085648'>, <MagicMock name='print' id='139964006033616'>]
      entered_patchers = [<mock._patch object at 0x7f4c444bd050>, <mock._patch object at 0x7f4c444add50>]
      exc_info = (<class '_pytest.assertion.reinterpret.AssertionError'>, AssertionError(u"assert 2 == 4\n +  where 2 = <MagicMock name='print' id='139964006033616'>.call_count",), <traceback object at 0x7f4c42ccfab8>)
      patching = <mock._patch object at 0x7f4c444bd050>, arg = <MagicMock name='print' id='139964006033616'>
      
      >   ???
      
      build/bdist.linux-x86_64/egg/mock.py:1201: 
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
      
      self = <client.commands.test_version.TestVersionCommand testMethod=test_version_with_new_pants>
      mock_buildinfo = <PropertyMock name='build_properties' id='139965496085648'>
      mock_print = <MagicMock name='print' id='139964006033616'>
      
          @patch('__builtin__.print')
          @patch('twitter.common.python.pex.PexInfo.build_properties', new_callable=PropertyMock)
          def test_version_with_new_pants(self, mock_buildinfo, mock_print):
            # New versions of pants write out revision and datetime
            mock_buildinfo.return_value = {'revision': 'bar', 'datetime': 'somedatetime'}
            version([])
      >     assert mock_print.call_count == 4
      E     AssertionError: assert 2 == 4
      E      +  where 2 = <MagicMock name='print' id='139964006033616'>.call_count
      
      src/test/python/apache/aurora/client/commands/test_version.py:42: AssertionError
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      ========================== 1 failed, 429 passed, 2 warnings in 49.45 seconds ==========================
      

      Attachments

        Activity

          People

            kevints Kevin Sweeney
            kevints Kevin Sweeney
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: