From 6281c86d5eec6c7ca370f25591f9bf09dac1f3ee Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 12 Oct 2022 10:46:56 +0200 Subject: [PATCH] [FIX] conftest: local webhook support Not sure how I missed this but apparently pytest fixtures can't return or yield, it's one or the other. Which makes a lot of sense but means the tunnel fixture was broken when using local webhooks (= no tunnel) as it returned the local url rather than yield it. --- conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index e3dd70d4..8e9a7e66 100644 --- a/conftest.py +++ b/conftest.py @@ -184,7 +184,7 @@ def tunnel(pytestconfig, port): """ tunnel = pytestconfig.getoption('--tunnel') if tunnel == '': - return f'http://localhost:{port}' + yield f'http://localhost:{port}' elif tunnel == 'ngrok': web_addr = 'http://localhost:4040/api' addr = 'localhost:%d' % port