mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
596bccde49
this does not generate coverage report yet
26 lines
766 B
Python
26 lines
766 B
Python
import pytest
|
|
import time
|
|
from context import HGECtx, HGECtxError
|
|
|
|
def pytest_addoption(parser):
|
|
parser.addoption(
|
|
"--hge-url", metavar="HGE_URL", help="url for graphql-engine", required=True
|
|
)
|
|
parser.addoption(
|
|
"--pg-url", metavar="PG_URL", help="url for connecting to Postgres directly", required=True
|
|
)
|
|
|
|
@pytest.fixture(scope='session')
|
|
def hge_ctx(request):
|
|
print ("create hge_ctx")
|
|
hge_url = request.config.getoption('--hge-url')
|
|
pg_url = request.config.getoption('--pg-url')
|
|
try:
|
|
hge_ctx = HGECtx(hge_url=hge_url, pg_url=pg_url)
|
|
except HGECtxError as e:
|
|
pytest.exit(str(e))
|
|
yield hge_ctx # provide the fixture value
|
|
print("teardown hge_ctx")
|
|
hge_ctx.teardown()
|
|
time.sleep(2)
|