Skip to content

[master|1.26.0] Test "test_container_attach_event" produces unhealthy output #7503

Closed

Description

This output looks like something is wrong in test tests/unit/cli/log_printer_test.py::TestWatchEvents::test_container_attach_event. Would be cool to fix so that people running tests do not need to answer the same "what is wrong and if so what is it" question. Thank you! 🙏

# python -m pytest -v tests/unit/cli/log_printer_test.py::TestWatchEvents::test_container_attach_event
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.7.7, pytest-5.4.2, py-1.8.1, pluggy-0.13.1 -- /tmp/tmp.bOFM3p5N9T/compose/py37/bin/python
cachedir: .pytest_cache
rootdir: /tmp/tmp.bOFM3p5N9T/compose, inifile: tox.ini
plugins: cov-2.8.1
collected 1 item

tests/unit/cli/log_printer_test.py::TestWatchEvents::test_container_attach_event PASSED                                                                                                [100%]Exception in thread Thread-1:
Traceback (most recent call last):
  File "/tmp/tmp.bOFM3p5N9T/compose/compose/cli/log_printer.py", line 163, in tail_container_logs
    for item in generator(container, log_args):
  File "/tmp/tmp.bOFM3p5N9T/compose/compose/utils.py", line 61, in split_buffer
    for data in stream_as_text(stream):
  File "/tmp/tmp.bOFM3p5N9T/compose/compose/utils.py", line 37, in stream_as_text
    for data in stream:
TypeError: 'Mock' object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/tmp/tmp.bOFM3p5N9T/compose/compose/cli/log_printer.py", line 166, in tail_container_logs
    queue.put(QueueItem.exception(e))
AttributeError: 'str' object has no attribute 'put'



===================================================================================== 1 passed in 0.03s ======================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions