AndreyErmilov / pytest-mock-server

Mock server plugin for pytest
MIT License
27 stars 5 forks source link

feature: wait for server ready. #7

Closed BrightXiaoHan closed 2 years ago

BrightXiaoHan commented 2 years ago

Hi, I found a more flexible way to determine whether the flask server is ready. Because I make a force push to my fork repository, the lagacy PR can't be reopened. So I create a new PR here.

  1. Use flask function url_for to dynamic get request url.
  2. In the main thread, Loop forever util it can make a request to the server successfully.
  3. I expose a server_setting: server_ready_timeout to avoid dead circulation.

Solved #6