Skip to content

Conversation

Eclips4
Copy link
Member

@Eclips4 Eclips4 commented Jan 27, 2024

From name of test (test_spawn_doesnt_hang) I can assume that purpose of this test - check that spawn doesn't hang, so I had chosen this approach.
Another approach may be the same as in #114565.

@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Jan 27, 2024

def test_spawn_doesnt_hang(self):
pty.spawn([sys.executable, '-c', 'print("hi there")'])
pty.spawn([sys.executable, '-c', '1 + 1'])
Copy link
Member

Choose a reason for hiding this comment

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

It may be a part of the manual testing. pty.spawn() runs subprocess and copy its stdout to this process stdout (fileno 1). The change that added this test ensured that pty.spawn() returns when reading from child returns empty bytes. But this test can implicitly test that pty.spawn() works at all and does not return before copying all child's output to stdout.

I try to automate this in #114647.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants