-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
bpo-18299: Improving eintrdata's test suites #13847
Conversation
It would be increase the function's complexity, but it looks like a unified function.
Lib/test/support/script_helper.py
Outdated
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) |
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.
Same thing as over.
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.
done:)
Did you test this change? If not, please provide it. |
Furthermore, you also need to fix the doc adding the parameter in the signature. |
|
@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. |
For a new feature in |
@gpshead Thanks for review. According your and victor's opinion, I refactor the eintr_tester's test suites. |
|
||
@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) |
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 don't see how this is beneficial. The point of that method is to avoid having to type '-c' everywhere.
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.
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.
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 |
https://bugs.python.org/issue18299