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

Function startUpMockServer

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

Source from the content-addressed store, hash-verified

28
29@pytest.fixture(scope="session", autouse=True)
30def startUpMockServer():
31 os.environ["QUANTUM_MACHINES_API_KEY"] = "00000000000000000000000000000000"
32 cudaq.set_target("quantum_machines", url="http://localhost:{}".format(port))
33
34 # Launch the Mock Server
35 p = Process(target=start_server, args=(port,))
36 p.start()
37
38 if not check_server_connection(port):
39 p.terminate()
40 pytest.exit("Mock server did not start in time, skipping tests.",
41 returncode=1)
42
43 yield "Server started."
44
45 # Kill the server
46 p.terminate()
47
48
49@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