Page MenuHomePhabricator
Paste P14377

SIGH
ActivePublic

Authored by Kormat on Tue, Feb 16, 1:31 PM.
@pytest.fixture(params=dbver.DB_VERSIONS, ids=lambda d: d.ver)
def deploy_replicate_all_versions(request):
deploy_ver(common.TOPO_TYPE_REPLICATION, request.param.ver)
yield request.param
undeploy_all()
@pytest.fixture(scope="class", params=dbver.DB_VERSIONS, ids=lambda d: d.ver)
def deploy_replicate_all_versions_class(request):
deploy_ver(common.TOPO_TYPE_REPLICATION, request.param.ver)
yield request.param
undeploy_all()
#### Try this
def _deploy_replicate_all_versions(request):
deploy_ver(common.TOPO_TYPE_REPLICATION, request.param.ver)
yield request.param
undeploy_all()
deploy_replicate_all_versions = pytest.fixture(params=dbver.DB_VERSIONS, ids=lambda d: d.ver)(_deploy_replicate_all_versions)
deploy_replicate_all_versions_class = pytest.fixture(scope="class", params=dbver.DB_VERSIONS, ids=lambda d: d.ver)(_deploy_replicate_all_versions)

Event Timeline

Kormat updated the paste's language from autodetect to python.
@pytest.fixture(params=dbver.DB_VERSIONS, ids=lambda d: d.ver)
def deploy_replicate_all_versions(request):
    yield from _deploy_replicate_all_versions(request)


@pytest.fixture(scope="class", params=dbver.DB_VERSIONS, ids=lambda d: d.ver)
def deploy_replicate_all_versions_class(request):
    yield from _deploy_replicate_all_versions(request)


def _deploy_replicate_all_versions(request):
    deploy_ver(common.TOPO_TYPE_REPLICATION, request.param.ver)
    yield request.param
    undeploy_all()