Kevin Sweeney created AURORA-938:
------------------------------------
Summary: TestVersionCommand::test_version_with_new_pants fails
under py.test
Key: AURORA-938
URL: https://issues.apache.org/jira/browse/AURORA-938
Project: Aurora
Issue Type: Bug
Components: Client, Testing
Reporter: Kevin Sweeney
Command run:
{noformat}
(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
==========================
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)