-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Properly override stdout on Python 2 and Python 3 in test_scripts_base #2592
Conversation
@rodrigc, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rutsky, @tomprince and @tardyp to be potential reviewers. |
@@ -33,7 +34,10 @@ class TestIsWorkerDir(misc.FileIOMixin, misc.StdoutAssertionsMixin, | |||
|
|||
def setUp(self): | |||
# capture output to stdout | |||
self.mocked_stdout = io.BytesIO() | |||
if PY3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't that NativeStringIO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but when I tried to use twisted.python.compat.NativeStringIO inside
buildbot_worker, tests broke because apparently
you are testing buildbot_worker in environments with old versions of Twisted which do not have NativeStringIO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have a compat.py
buildbot_worker.compat.NativeStringIO
buildbot_worker.compat.enforceNative
buildbot_worker.compat.enforceString
buildbot_worker.compat.enforceBytes
That is what I meant by backporting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer when you say something that you say exactly what you want.
I can't guess what's in your mind, and don't like submitting multiple guesses of what you want and getting it wrong.
Refactoring depends on #2600 |
Refactoring completed |
thanks! |
This fixes test_scripts_base on Python 3.