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

Function startUpMockServer

python/tests/backends/test_qbraid.py:52–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51@pytest.fixture(scope="session", autouse=True)
52def startUpMockServer():
53 cudaq.set_random_seed(13)
54 os.environ["QBRAID_API_KEY"] = TEST_API_KEY
55
56 _set_qbraid_target()
57
58 p = Process(target=startServer, args=(port,))
59 p.start()
60
61 if not check_server_connection(port):
62 p.terminate()
63 pytest.exit("Mock server did not start in time, skipping tests.",
64 returncode=1)
65
66 yield "Server started."
67
68 p.terminate()
69
70
71@pytest.fixture(scope="function", autouse=True)

Callers

nothing calls this directly

Calls 4

check_server_connectionFunction · 0.90
_set_qbraid_targetFunction · 0.85
exitMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected