Skip to content

Save the line matching ProcessStarter.pattern #160

@dholth

Description

@dholth

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions