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

Wait for the previous pytest process to exit before re-running #36

Closed
joeyespo opened this issue Dec 4, 2015 · 2 comments · Fixed by michaeljoseph/mould#12
Closed

Comments

@joeyespo
Copy link
Owner

joeyespo commented Dec 4, 2015

The proposal is to send SIGTERM to the pytest process when pytest-watch observes a file change. It'll then wait for the process to finish before starting the new cycle.

This will solve #23 as well as any other quirky behavior that comes from having two pytest instances running the same test suite.

This could also help with #21. The underlying question is what to do when a test initiates an interactive session like pdb. If pdb ignores our termination signal, we're done. If not, we may also need a --full CLI argument to tell pytest-watch to wait out the full test session before starting the new one. Similar to how pytest automatically adds -s when you use --pdb, pytest-watch can automatically add --full when --pdb is present in pytest's argument list or in the config file.

@sysradium
Copy link

@joeyespo well I think this can be easily solved just by adding a non-blocking lock to the ChangeHandler.run(...) for example. At least I did so.

When we drop into pdb your watcher freezes here https://github.com/joeyespo/pytest-watch/blob/master/pytest_watch/watcher.py#L111. So we can just prevent us from reaching this point when there is another subprocess.call waiting. Example sysradium@f93e74a

Yes, this can be controlled by the --full arg. But the name seems a little bit confusing.

@joeyespo
Copy link
Owner Author

joeyespo commented Apr 6, 2016

Fixed with 0cf6b93.

Just published v4.0, which includes this.

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

Successfully merging a pull request may close this issue.

2 participants