Live server subprocess
Please don't merge this yet. There is still one test that is not passing for a mysterious reason, and additionally this code still needs test cases of its own.
I'm working on a way to launch flask as a completely separate process using os.fork by way of watcher_getter (from pytest-services).
The reason I need to use this strategy is that SQLAlchemy configurations become considerably more complex when you have to deal with multiprocessing (see docs). I was struggling to get it to work in my existing configuration, and this seemed like the easier option.
Let me know if you have any initial feedback and I'll circle back. Thanks @vitalk!
Hi @fuhrysteve! This changes looks good for me. But live_server_subprocess fixture can be always available (not only when pytest-service is exists).
It would be great if live_server_subprocess fixture can detect missed requirements as well (such as flask>=0.11.0 or pytest-service) and skip tests with helpful message.
Use the separate --start-live-server-subprocess option to run live_server fixture as subprocess is another suggestion. Any thoughts?
@vitalk So I think the issue with always making live_server_subprocess always available is I'm not sure off the top of my head how to do that without making all tests fail at collection time - the reason is that watcher_getter would fail because it says it can't find a fixture with that name.
So I'm not sure how to make it optionally available unless there's some way I'm not aware of to get a fixture at runtime.
Any suggestions?
@vitalk with regards to --start-live-server-subprocess, sounds like a good idea to me - i'll add it in.
the reason is that
watcher_getterwould fail because it says it can't find a fixture with that name
I missed that part, maybe I can find a workaround.