switch to using a thread for the live server#112
Conversation
Running the server in a thread works quite well, and prevents any issues with communication between processes. Furthermore, it fixes stdio capturing to work as expected.
|
Excellent idea! Thanks for the contribution. I am not familiar with Werkzeug's API to create servers but it looks like there is an option for threading here: https://github.com/pallets/werkzeug/blob/master/werkzeug/serving.py#L576. Is there a reason you're using a thread over the threaded mixin server? |
Well, yes; I wanted to use the I tried switching my application to the Flask configuration system, and noticed that it didn't seem to affect the live server with these changes. I'll try to come up with a test to check whether that's a regression. |
|
That was my thought - wanted to make sure I had the right idea. This is great. Let's get a test for that regression if you can manage it and then we'll merge |
Running the server in a thread works quite well, and prevents any
issues with communication between processes. Furthermore, it fixes
stdio capturing to work as expected.
Tested by using something similar in my own test suite on Python 3.6, and by running
Flask-Testing's own suite on Python 2.6, 2.7 and 3.6.