pytest-dev / pytest-dev/pytest-flask
Run liveserver fixture on another server
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 499
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
I use the liveserver fixture in the testing suite for my app. I have recently switched my app to run using waitress in the production environment. To run using waitress, I do something similar to:
from waitress import serve
app = create_app()
serve(app)
This uses serve rather than app.run(). I'd really like to be able to easily run the live server fixture using this same format. As far as I can tell, the relevant line of code is here. It would be nice to be able to override or configure how this runs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pytest_flask/live_server.py at the referenced line where the live server is started, and compare its current app.run() flow with the waitress serve(app) example. Determine how the startup method could be overridden or configured, then verify that the liveserver fixture can use an alternative server while preserving its existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- backend, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100