bpo-18299: Improving eintrdata's test suites by shihai1991 · Pull Request #13847 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation13 Commits5 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

shihai1991

@shihai1991

It would be increase the function's complexity, but it looks like a unified function.

mangrisano

env.update(env_vars)
cmd_line.extend(args)
proc = subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
env=env, cwd=cwd)
env=env, cwd=cwd,
universal_newlines=universal_newlines)

Choose a reason for hiding this comment

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

Same thing as over.

Choose a reason for hiding this comment

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

done:)

@blurb-it

@shihai1991 shihai1991 changed the title[WIP] bpo-18299: Adding universal_newlines in script_helper like a unified way bpo-18299: Adding universal_newlines in script_helper like a unified way

Jun 7, 2019

@shihai1991

@mangrisano

Did you test this change? If not, please provide it.

@mangrisano

Furthermore, you also need to fix the doc adding the parameter in the signature.

@shihai1991

Did you test this change? If not, please provide it.
Let us waiting other developer's opinion, if they think this patch is fine, i will replenish it;)

@shihai1991

@vstinner Hi, Victor. Looks i choose the complicated way of script_helper. Maybe i could find the way which you said to supply popen more easily.

@gpshead

For a new feature in test.support.script_helper it would help to have some motivating examples refactoring some existing test suite to cleaner due to the new API.

@shihai1991

@shihai1991

@shihai1991

@gpshead Thanks for review. According your and victor's opinion, I refactor the eintr_tester's test suites.
And pls forget my previous patch;)

@shihai1991 shihai1991 changed the titlebpo-18299: Adding universal_newlines in script_helper like a unified way bpo-18299: Improving eintrdata's test suites

Jun 13, 2019

gpshead

@unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()")
class OSEINTRTest(EINTRBaseTest):
""" EINTR tests for the os module. """
def new_sleep_process(self):
code = 'import time; time.sleep(%r)' % self.sleep_time
return self.subprocess(code)
return spawn_python('-c', code)

Choose a reason for hiding this comment

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

I don't see how this is beneficial. The point of that method is to avoid having to type '-c' everywhere.

Choose a reason for hiding this comment

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

This doesn't materially improve the eintrdata test suite and the issue it links to is about script_helper, _assert_python, and text mode to the child. which don't seem to be a problem in eintrdata_tester.py

ok, the spawn_python in script_helper is good enough. Forget this.

@gpshead

This doesn't materially improve the eintrdata test suite and the issue it links to is about script_helper, _assert_python, and text mode to the child. which don't seem to be a problem in eintrdata_tester.py