|
10 | 10 | from cudaq.operator import *
|
11 | 11 | import json
|
12 | 12 | import numpy as np
|
13 |
| -import os |
14 | 13 | import pytest
|
15 |
| -from multiprocessing import Process |
16 |
| -from network_utils import check_server_connection |
17 |
| - |
18 |
| -try: |
19 |
| - from utils.mock_qpu.quera import startServer |
20 |
| -except: |
21 |
| - print("Mock qpu not available, skipping QuEra tests.") |
22 |
| - pytest.skip("Mock qpu not available.", allow_module_level=True) |
23 |
| - |
24 |
| -# Define the port for the mock server |
25 |
| -port = 62444 |
26 | 14 |
|
27 | 15 |
|
28 | 16 | @pytest.fixture(scope="session", autouse=True)
|
29 |
| -def startUpMockServer(): |
30 |
| - # NOTE: Credentials can be set with AWS CLI |
31 |
| - cudaq.set_target('quera') |
32 |
| - # Launch the Mock Server |
33 |
| - p = Process(target=startServer, args=(port,)) |
34 |
| - p.start() |
35 |
| - if not check_server_connection(port): |
36 |
| - p.terminate() |
37 |
| - pytest.exit("Mock server did not start in time, skipping tests.", |
38 |
| - returncode=1) |
| 17 | +def do_something(): |
| 18 | + cudaq.set_target("quera") |
39 | 19 | yield "Running the tests."
|
40 |
| - p.terminate() |
| 20 | + cudaq.reset_target() |
41 | 21 |
|
42 | 22 |
|
43 |
| -@pytest.mark.skip(reason="Amazon Braket credentials required") |
| 23 | +@pytest.mark.skip(reason="Amazon Braket must be installed") |
44 | 24 | def test_JSON_payload():
|
45 | 25 | '''
|
46 | 26 | Test based on https://docs.aws.amazon.com/braket/latest/developerguide/braket-quera-submitting-analog-program-aquila.html
|
@@ -88,7 +68,7 @@ def test_JSON_payload():
|
88 | 68 | json.dumps(input))
|
89 | 69 |
|
90 | 70 |
|
91 |
| -@pytest.mark.skip(reason="Braket credentials required") |
| 71 | +@pytest.mark.skip(reason="Amazon Braket credentials required") |
92 | 72 | def test_ahs_hello():
|
93 | 73 | '''
|
94 | 74 | Test based on
|
|
0 commit comments