pytest-xprocess icon indicating copy to clipboard operation
pytest-xprocess copied to clipboard

Save the line matching ProcessStarter.pattern

Open dholth opened this issue 5 months ago • 0 comments

I like using OS-assigned ports in test servers where a server binds to port 0, and then communicates the OS-chosen port, say, by printing it out. The linked code uses a pattern and a callback. The callback reads the log file, finds the newest matching pattern, and uses that to determine the port. Instead, https://github.com/pytest-dev/pytest-xprocess/blob/master/xprocess/xprocess.py#L424 could remember the matching pattern on a class property. Then important information about the process could be more easily referenced later.

dholth avatar Sep 10 '25 17:09 dholth