MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / startUpMockServer

Function startUpMockServer

python/tests/backends/test_IonQ.py:30–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29@pytest.fixture(scope="session", autouse=True)
30def startUpMockServer():
31 cudaq.set_random_seed(13)
32
33 os.environ["IONQ_API_KEY"] = "00000000000000000000000000000000"
34
35 # Set the targeted QPU
36 cudaq.set_target("ionq", url="http://localhost:{}".format(port))
37
38 # Launch the Mock Server
39 p = Process(target=startServer, args=(port,))
40 p.start()
41
42 if not check_server_connection(port):
43 p.terminate()
44 pytest.exit("Mock server did not start in time, skipping tests.",
45 returncode=1)
46
47 yield "Server started."
48
49 # Kill the server
50 p.terminate()
51
52
53@pytest.fixture(scope="function", autouse=True)

Callers

nothing calls this directly

Calls 4

check_server_connectionFunction · 0.90
formatMethod · 0.80
exitMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected