()
| 28 | |
| 29 | @pytest.fixture(scope="session", autouse=True) |
| 30 | def 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) |
nothing calls this directly
no test coverage detected