This solution worked for me.
import pytest
from pytest_metadata.plugin import metadata_key
@pytest.hookimpl(tryfirst=True) def pytest_sessionfinish(session, exitstatus): session.config.stash[metadata_key]["Base URL"] = "https://google.com" #replace with your Base URL