Skip to content

bpo-29070: Integration tests for pty module with patch from bpo-26228 #2932

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

Closed
wants to merge 26 commits into from

Conversation

diekmann
Copy link
Contributor

@diekmann diekmann commented Jul 28, 2017

TL;DR: Fix issue and add huge test suite for pty.py.

Some development of a test suite with integration tests for the pty module happened over several months in the python bug tracker (when python was still on mercurial). Martin Panter already did some awesome review of the code, unfortunately he is currently unavailable and nothing happened in the bug tracker for some months. This is the github pull request of the test suite.

Summary what happened so far:

  • Chris Torek observed and fixed a bug in the pty module bpo-26228. People seem to agree about the bug and that the patch by Chris solves the problem. However, it was never merged, probably due to missing test cases.
  • Independently, I wrote a kind-of-large test suite and integration tests for the pty module bpo-29070. Martin Panter and Xavier de Gaye helped improving the code. Some comments are still in the review tool.
  • Just a test suite for the pty module cannot be merged because the tests fail on Mac OS, FreeBSD, ... This is why I include Chris Torek's patch into this pull request. On all systems I could test on, the test suite passes (but I cannot rule out that there are some strange UNIX flavors where we will uncover issues).

If this gets merged, we can close two bpo issues and finally have a nice pty test suite, something that is missing for a long time.

Contributors: Patch from Chris Torek [bpo-26228] is included in this pull request! I added him to the ACKS, but I'm not sure if he wants to appear there.

https://bugs.python.org/issue29070

diekmann added 25 commits July 28, 2017 17:13
this is pty.patch, "test suite v4 including patch for issue26228",
2017-02-09 18:31
http://bugs.python.org/file46613/pty.patch

http://bugs.python.org/issue29070
We need to monkey patch the freshly spawned child! Tested that it is
actually called by writing to stderr (test code commented out, I don't
want to push the verbose flag through all those children).
Awesome idea by Martin Panter!
PtySpawnTestBase (though it does not define any tests) wants to inherit
from unittest to have self.fail() available
We don't capture stdin/stdout by running the child and returning what
was written once the child is done.  We spawn the child and have the
pipes available to communicate with the child while it is running.
* remove unrealted code comment
* tune documentation
* rename function
* remove if verbose
Now that code is closer together, we can move up more into the setUp
methods.
Better terminology, clearly introducing background/slave.
We still have test_eof. And test_bell_echoctl tests echoctl.
"Also, no documentation string for the method should be included. A
comment (such as # Tests function returns only True or False) should be
used to provide documentation for test methods. This is done because
documentation strings get printed out if they exist and thus what test
is being run is not stated." /Doc/build/html/library/test.html
TODO: This branch also includes the patch from Chris Torek bpo-26228.
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@diekmann
Copy link
Contributor Author

The diff of this PR is just too large. Closed in favor of #3808, #4167, and hopefully more to come.

@diekmann diekmann closed this Oct 29, 2017
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.

3 participants