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 with Session Scope

TWood67 opened this issue · comments

Creating a live server is expensive, especially when its done for every function. Is it possible to have different options when it comes to scope? I'd like to create a live server that lasts for the entire session. I'd be more than happy to contribute and add this functionality.

Hi @TWood67,

Thanks for the offer!

Yes I think this would be a nice functionality to add, we might even consider using dynamic scopes for that.

There was a previous attempt to make the live_server to use the session scope here: #63

But it's been 2 years since he made the PR.

I'm hoping for this feature to be implemented soon

Thanks for the help! I'll check out #63 and see where I can go from there

I suggest to take a different approach than #63 though: use the example of dynamic scopes I posted earlier so that users can control the scope of the live-server fixture from an ini option.