wiremock / python-wiremock

A Python library for API mocking and testing with Testcontainers module and WireMock

Home Page:https://wiremock.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow the port of the server to be set at initialization

OlafMeuwese opened this issue · comments

Problem
The server port is now always random, making it sometimes hard to set the connection url in tests, (for instance in properties) because the port number is not determined before runtime.

Cause
The constructor method now always uses the port from the _get_free_port() method.

Solution
Add parameter to the constructor method. If none is provided, fall back to the _get_free_port() method. This should be backwards compatible.

Willing to work on this, however I wanna know if the vision on this issue is shared by the maintainers.

@OlafMeuwese PR's welcome :)

Is this being worked upon?

fixed and released in 2.0.0