def conn(request): """Fixture that yields connection object. """ name = f"test_{request.param}" # connect to dbase if request.param == "arctic": connstr = "mongodb://localhost:27017/" conn = pst.ArcticConnector(name, connstr) elif request.param == "pystore": path = "./tests/data/pystore" conn = pst.PystoreConnector(name, path) elif request.param == "dict": conn = pst.DictConnector(name) elif request.param == "pas": conn = pst.PasConnector(name, "./tests/data/pas") else: raise ValueError("Unrecognized parameter!") conn.type = request.param # added here for defining test dependencies yield conn
def pstore(request): if request.param == "arctic": connstr = "mongodb://localhost:27017/" name = "test_project" connector = pst.ArcticConnector(name, connstr) elif request.param == "pystore": name = "test_project" path = "./tests/data/pystore" pystore.set_path(path) connector = pst.PystoreConnector(name, path) elif request.param == "dict": name = "test_project" connector = pst.DictConnector(name) elif request.param == "pas": name = "test_project" connector = pst.PasConnector(name, "./tests/data/pas") else: raise ValueError("Unrecognized parameter!") pstore = initialize_project(connector) pstore.type = request.param # added here for defining test dependencies yield pstore
def test_benchmark_read_series_pas(benchmark): conn = pst.PasConnector("test", "./tests/data/pas") _ = benchmark(series_read, conn=conn) return
def test_benchmark_read_model_pas(benchmark): conn = pst.PasConnector("test", "./tests/data/pas") _ = benchmark(read_model, conn=conn) pst.util.delete_pas_connector(conn) return
def test_benchmark_write_model_nocheckts_pas(benchmark): conn = pst.PasConnector("test", "./tests/data/pas") ml = build_model(conn) _ = benchmark(write_model_nocheckts, conn=conn, ml=ml) return