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