()
| 38 | |
| 39 | @pytest.fixture(scope="session", autouse=True) |
| 40 | def startUpMockServer(): |
| 41 | # Write a fake access tokens file |
| 42 | with tempfile.NamedTemporaryFile(delete=False) as tmp_tokens_file: |
| 43 | write_a_mock_tokens_file(tmp_tokens_file.name) |
| 44 | |
| 45 | # Launch the Mock Server |
| 46 | p = Process(target=startServer, args=(port,)) |
| 47 | p.start() |
| 48 | |
| 49 | if not check_server_connection(port): |
| 50 | p.terminate() |
| 51 | pytest.exit("Mock server did not start in time, skipping tests.", |
| 52 | returncode=1) |
| 53 | |
| 54 | cudaq.set_random_seed(13) |
| 55 | # Set the targeted QPU |
| 56 | os.environ["IQM_TOKENS_FILE"] = tmp_tokens_file.name |
| 57 | cudaq.set_target("iqm", url="http://localhost:{}".format(port)) |
| 58 | |
| 59 | yield "Running the tests." |
| 60 | |
| 61 | # Kill the server, remove the tokens file |
| 62 | p.terminate() |
| 63 | os.remove(tmp_tokens_file.name) |
| 64 | |
| 65 | cudaq.reset_target() |
| 66 | |
| 67 | |
| 68 | def test_iqm_ghz(): |
nothing calls this directly
no test coverage detected