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

Properly override stdout on Python 2 and Python 3 in test_scripts_base #2592

Merged
merged 1 commit into from
Jan 16, 2017
Merged

Properly override stdout on Python 2 and Python 3 in test_scripts_base #2592

merged 1 commit into from
Jan 16, 2017

Conversation

rodrigc
Copy link
Contributor

@rodrigc rodrigc commented Jan 14, 2017

This fixes test_scripts_base on Python 3.

@mention-bot
Copy link

@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.

@rodrigc rodrigc changed the title Properly override stdout on Python 2 and Python 3 Properly override stdout on Python 2 and Python 3 in test_scripts_base Jan 14, 2017
@@ -33,7 +34,10 @@ class TestIsWorkerDir(misc.FileIOMixin, misc.StdoutAssertionsMixin,

def setUp(self):
# capture output to stdout
self.mocked_stdout = io.BytesIO()
if PY3:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that NativeStringIO?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

@rodrigc
Copy link
Contributor Author

rodrigc commented Jan 15, 2017

Refactoring depends on #2600

@rodrigc
Copy link
Contributor Author

rodrigc commented Jan 16, 2017

Refactoring completed

@tardyp tardyp merged commit 73756ea into buildbot:master Jan 16, 2017
@tardyp
Copy link
Member

tardyp commented Jan 16, 2017

thanks!

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.

None yet

3 participants