Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix testing: add flush() to the Tee class #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tosky
Copy link
Contributor

@tosky tosky commented Feb 25, 2023

The Tee class is used as stdout-like object, but
it was missing the flush method. That method is called by some code which is replaced by instances of Tee, leading to errors:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "<...>/tests/test_options.py", line 94, in test_old_var_compatibility
p.program('export', {'--template': 'foobar-%s-1234.pot'})
[...]
File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 177, in write
self.write_and_convert(text)
File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 202, in write_and_convert
self.write_plain_text(text, cursor, start)
File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 211, in write_plain_text
self.wrapped.flush()
^^^^^^^^^^^^^^^^^^
AttributeError: 'Tee' object has no attribute 'flush'

The Tee class is used as stdout-like object, but
it was missing the flush method. That method is called
by some code which is replaced by instances of Tee,
leading to errors:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "<...>/tests/test_options.py", line 94, in test_old_var_compatibility
    p.program('export', {'--template': 'foobar-%s-1234.pot'})
  [...]
  File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 177, in write
    self.write_and_convert(text)
  File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 202, in write_and_convert
    self.write_plain_text(text, cursor, start)
  File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 211, in write_plain_text
    self.wrapped.flush()
    ^^^^^^^^^^^^^^^^^^
AttributeError: 'Tee' object has no attribute 'flush'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant