Fix bug with previous release where internal module was missing
:method:`ProcessInfo.terminate` will now terminate outer leaves in process tree first and work its way towards root process. For example, if a process has child and grandchild, xprocess will terminate first child and grandchild and only then will the root process receive a termination signal.
ProcessStarternow has attr:terminate_on_interrupt. This flag will make xprocess attempt to terminate and clean up all started process resources upon interruptions during pytest runs (CTRL+C, SIGINT and internal errors) when set to True. It will default to False, so if the described behaviour is desired the flag must be explicitly set True.
Add a new popen_kwargs variable to ProcessStarter, this variable can be used for passing keyword values to the subprocess.Popen constructor, giving the user more control over how the process is initialized.
Fix ResourceWarning in
XProcess.ensure()caused by not properly waiting on process exit and leaked File handles
startup_check(). This method can be optionaly overridden and will be called upon to check process responsiveness after
ProcessStarter.patternis matched. By default,
XProcess.ensure()will only attempt to match
ProcessStarter.patternwhen starting a process, if matched, xprocess will consider the process as ready to answer queries. If
startup_check()is provided though, its return value will also be considered to determine if the process has been successfully started. If
startup_check()returns True after
ProcessStarter.patternhas been matched,
XProcess.ensure()will return sucessfully. In contrast, if
startup_check()does not return True before timing out,
XProcess.ensure()will raise a TimeoutError exception.
ProcessStarternow has a new timeout class variable optionaly overridden to define the maximum time
xprocess.ensure()should wait for process output when trying to match
ProcessStarter.pattern. Defaults to 120 seconds.
The number of lines in the process logfile watched for
ProcessStarter.patternis now configurable and can be changed by setting
ProcessStarter.max_read_linesto the desired value. Defaults to 50 lines.
XProcessInfo.isrunning()ignore zombie processes by default. Pass
ignore_zombies=Falseto get the previous behavior, which was to consider zombie processes as running.
pytest-xprocess now uses a sub-directory of .pytest_cache to store process related files.
Drop support for Python 2.7
Fixed bug when non-ascii characters were written to stdout by external process
XProcessInfo.terminatewill by default also terminate the entire process tree. This is safer as there’s no risk of leaving lingering processes behind. If for some reason you need the previous behavior of only terminating the root process, pass
Drop support for Python 2.6 and 3.4.
Ignore empty lines in log files when looking for the pattern that indicates a process has started.
Never released due to deploy issues.
Fixed example in README.md
XProcess.ensure()now accepts preferably a ProcessStarter subclass to define and customize the process startup behavior. Passing a simple function is deprecated and will be removed in a future release.
XProcessInfo.kill()as alias for
XProcessInfo.terminate()for API compatibility.
When tearing down processes (through
--xkill), the more polite SIGTERM is used before invoking SIGKILL, allowing the process to cleanly shutdown. See https://github.com/pytest-dev/pytest-xprocess/issues/1 for more details.
Don’t use __multicall__ in pytest hook
Fix issue Log calls without parameters now print the correct message instead of an empty tuple. See https://bitbucket.org/pytest-dev/pytest-xprocess/pull-request/3 for more info.
Use 3rd party psutil library for process handling
Support python3 (tested on linux/win32)
Split out pytest independent process support into xprocess.py
Add method:xProcessInfo.kill and some smaller refactoring
Fix various windows related Popen / killing details