pytest-services
pytest-services copied to clipboard
Function scoped processes
Currently, watcher_getter
is session scoped, which means that the finalizer will be session scoped too. Would it make sense to have watcher_getter_function
accept request
from the "real" fixture instead of the request from watcher_getter
?
The implementations of process fixtures would then have to pass request explicitly:
@pytest.fixture
def celery(request):
return watcher_getter(request, 'celery', ['worker'])
(I'm trying to implement a celery worker that run function scoped, will open a separate issue to see if that is a good fit for pytest-services)
hmm, not sure why would you start/stop process on every test - that's time consuming I agree with the proposed change - it's useful anyways please PR