pytest-dev / pytest-flask

A set of pytest fixtures to test Flask applications

Home Page:http://pytest-flask.readthedocs.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

live_server listening on configurable HOST

o1da opened this issue · comments

Live_server can run only on 127.0.0.1 interface because it doesn't set host parameter for app.run call
https://github.com/pytest-dev/pytest-flask/blob/master/pytest_flask/fixtures.py#L65

Does it make sense to add this option? I use different docker containers for testing (one with pytest, one with selenium chrome standalone). And if selenium tries to connect to the live_server it fails because it listens inside a different container on the localhost interface. I probably can use tools like socat to propagate localhost outside the container, or maybe run docker container with --network="host" and use it accordingly. But for me, it seems to be the most appropriate to configure live_server.

Hi @o1da,

Yes I think it makes sense to include a --live-server-host option, thanks for the suggestion.

A PR would be very welcome! 👍

PR is prepared :)

Thanks again @o1da!