pytest-services icon indicating copy to clipboard operation
pytest-services copied to clipboard

Function scoped processes

Open pelme opened this issue 9 years ago • 1 comments

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)

pelme avatar Aug 18 '15 10:08 pelme

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

bubenkoff avatar Aug 20 '15 22:08 bubenkoff