Skip to content

Instantly share code, notes, and snippets.

@twaugh
Created September 13, 2017 14:24
Show Gist options
  • Save twaugh/aba3a559592059fa9266ac1e10b88f0e to your computer and use it in GitHub Desktop.
Save twaugh/aba3a559592059fa9266ac1e10b88f0e to your computer and use it in GitHub Desktop.
$ coverage run --branch /usr/bin/py.test tests
============================= test session starts ==============================
platform linux2 -- Python 2.7.13, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
rootdir: /home/twaugh/devel/koji-containerbuild, inifile:
plugins: pep8-1.0.6, cov-2.4.0, capturelog-0.7
collected 42 items
tests/test_kcb.py .......................F..................
=================================== FAILURES ===================================
________________________ TestBuilder.test_flatpak_build ________________________
def flexmock_teardown():
"""Performs lexmock-specific teardown tasks."""
saved = {}
instances = []
classes = []
for mock_object, expectations in FlexmockContainer.flexmock_objects.items():
saved[mock_object] = expectations[:]
for expectation in expectations:
_getattr(expectation, 'reset')()
for mock in saved.keys():
obj = mock._object
if not isinstance(obj, Mock) and not _isclass(obj):
instances.append(obj)
if _isclass(obj):
classes.append(obj)
for obj in instances + classes:
for attr in UPDATED_ATTRS:
try:
obj_dict = obj.__dict__
if _get_code(obj_dict[attr]) is _get_code(Mock.__dict__[attr]):
del obj_dict[attr]
except:
try:
if _get_code(getattr(obj, attr)) is _get_code(Mock.__dict__[attr]):
delattr(obj, attr)
except AttributeError:
pass
FlexmockContainer.teardown_properties()
FlexmockContainer.reset()
# make sure this is done last to keep exceptions here from breaking
# any of the previous steps that cleanup all the changes
for mock_object, expectations in saved.items():
for expectation in expectations:
> _getattr(expectation, 'verify')()
/usr/lib/python2.7/site-packages/flexmock.py:1180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python2.7/site-packages/flexmock.py:620: in verify
(_format_args(self.name, self.args), message, self.times_called))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <flexmock.Expectation object at 0x7fc6e0a70950>
exception = <class 'flexmock.MethodCallError'>
message = 'create_orchestrator_build(target="target-name", scratch=False, component="fedora-docker", module="fedora-docker:f26",...c7eded8b54e", flatpak=True, koji_task_id=123, architecture=None) expected to be called exactly 1 times, called 0 times'
def __raise(self, exception, message):
"""Safe internal raise implementation.
In case we're patching builtins, it's important to reset the
expectation before raising any exceptions or else things like
open() might be stubbed out and the resulting runner errors are very
difficult to diagnose.
"""
self.reset()
> raise exception(message)
E MethodCallError: create_orchestrator_build(target="target-name", scratch=False, component="fedora-docker", module="fedora-docker:f26", git_uri="git://pkgs.example.com/rpms/fedora-docker", platforms=['x86_64'], yum_repourls=[], user="owner-name", git_ref="b8120b486367ec33fbbfa408542eec7eded8b54e", flatpak=True, koji_task_id=123, architecture=None) expected to be called exactly 1 times, called 0 times
/usr/lib/python2.7/site-packages/flexmock.py:349: MethodCallError
--------------------------------- Captured log ---------------------------------
builder_containerbuild.py 622 DEBUG arches: x86_64
builder_containerbuild.py 627 DEBUG base archlist: ['x86_64']
=============================== warnings summary ===============================
:171
'pytest_runtest_makereport' hook uses deprecated __multicall__ argument
None
pytest_funcarg__caplog: declaring fixtures using "pytest_funcarg__" prefix is deprecated and scheduled to be removed in pytest 4.0. Please remove the prefix and use the @pytest.fixture decorator instead.
pytest_funcarg__capturelog: declaring fixtures using "pytest_funcarg__" prefix is deprecated and scheduled to be removed in pytest 4.0. Please remove the prefix and use the @pytest.fixture decorator instead.
-- Docs: http://doc.pytest.org/en/latest/warnings.html
=============== 1 failed, 41 passed, 3 warnings in 22.98 seconds ===============
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment