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