[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.
This commit is contained in:
Xavier Morel 2022-10-12 10:46:56 +02:00
parent fffc27d2fa
commit 6281c86d5e

View File

@ -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