pytest-dev / pytest-dev/pytest-flask

Run liveserver fixture on another server

Open
#153 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.