()
| 32 | |
| 33 | @pytest.fixture(scope="session", autouse=True) |
| 34 | def startUpMockServer(): |
| 35 | |
| 36 | cudaq.set_random_seed(13) |
| 37 | |
| 38 | os.environ["OQC_AUTH_TOKEN"] = "fake_auth_token" |
| 39 | os.environ["OQC_DEVICE"] = "qpu:uk:-1:1234567890" |
| 40 | os.environ["OQC_URL"] = f"http://localhost:{port}" |
| 41 | |
| 42 | # Launch the Mock Server |
| 43 | p = Process(target=startServer, args=(port,)) |
| 44 | p.start() |
| 45 | |
| 46 | if not check_server_connection(port): |
| 47 | p.terminate() |
| 48 | pytest.exit("Mock server did not start in time, skipping tests.", |
| 49 | returncode=1) |
| 50 | |
| 51 | # Set the targeted QPU |
| 52 | cudaq.set_target('oqc', |
| 53 | url=f'http://localhost:{port}', |
| 54 | auth_token="fake_auth_token") |
| 55 | yield "Running the tests." |
| 56 | |
| 57 | # Kill the server, remove the file |
| 58 | p.terminate() |
| 59 | |
| 60 | cudaq.reset_target() |
| 61 | |
| 62 | |
| 63 | def test_OQC_sample(): |
nothing calls this directly
no test coverage detected