Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/tests/backends/emulateInfleqtion.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@pytest.fixture(scope="session", autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("infleqtion", emulate=True)
yield "Running the tests."
cudaq.__clearKernelRegistries()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/backends/test_Infleqtion.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@pytest.fixture(scope="session", autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("infleqtion")
yield "Running the tests."
cudaq.__clearKernelRegistries()
Expand Down
3 changes: 2 additions & 1 deletion python/tests/backends/test_Pasqal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@


@pytest.fixture(scope="session", autouse=True)
def do_something():

def set_up_target():
# NOTE: Credentials can be set with environment variables.
# This test covers the direct `pasqal` backend only.
# QRMI-routed execution is validated separately because it requires a
Expand Down
2 changes: 1 addition & 1 deletion python/tests/backends/test_QuEra.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


@pytest.fixture(scope="session", autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("quera")
yield "Running the tests."
cudaq.reset_target()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/backends/test_braket.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


@pytest.fixture(scope="session", autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("braket")
yield "Running the tests."
cudaq.__clearKernelRegistries()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/backends/test_scaleway.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


@pytest.fixture(scope="session", autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("scaleway",
machine="EMU-CUDAQ-64C-512M",
max_duration="5m",
Expand Down
2 changes: 1 addition & 1 deletion python/tests/backends/test_tii.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


@pytest.fixture(scope="session", autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("tii",
device="tii-sim",
project=os.environ.get("TII_PROJECT", None))
Expand Down
2 changes: 1 addition & 1 deletion python/tests/custom/test_custom_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@pytest.fixture(autouse=True)
def do_something():
def reset_and_run():
cudaq.reset_target()
yield
## Ref: https://github.com/NVIDIA/cuda-quantum/issues/1954
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


@pytest.fixture(autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("dynamics")
yield
cudaq.reset_target()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/dynamics/test_evolve_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


@pytest.fixture(autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("dynamics")
yield
cudaq.reset_target()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/dynamics/test_evolve_simulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


@pytest.fixture(autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("density-matrix-cpu")
yield
cudaq.reset_target()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/handlers/test_photonics_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


@pytest.fixture(autouse=True)
def do_something():
def set_up_target():
cudaq.set_target("orca-photonics")
yield
cudaq.__clearKernelRegistries()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/interop/test_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_assignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_control_negations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_direct_call_return_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def is_close_array(actual, expected):


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_explicit_measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@pytest.fixture(autouse=True)
def do_something():
def reset_run_clear():
cudaq.reset_target()
yield
cudaq.__clearKernelRegistries()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_ir_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_kernel_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_kernel_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_library_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_observe_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_run_async_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def is_close_array(actual, expected):


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_run_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def is_close_array(actual, expected):


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_sample_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_state_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_state_mps.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()
cudaq.reset_target()
Expand Down
4 changes: 2 additions & 2 deletions python/tests/kernel/test_target_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@


@pytest.fixture
def do_something():
def set_up_target():
cudaq.set_target("nvidia", option="fp32")
yield "Running the tests."
cudaq.__clearKernelRegistries()
cudaq.reset_target()


@skipIfNoGPU
def test_target_valid_option_attribute(do_something):
def test_target_valid_option_attribute(set_up_target):
"""Tests the target valid option attribute."""

target = cudaq.get_target()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/kernel/test_unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/parallel/test_mpi_mqpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def mpi_init_finalize():


@pytest.fixture(autouse=True)
def do_something():
def set_up_target():
cudaq.set_target('nvidia-mqpu')
yield
cudaq.__clearKernelRegistries()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/parallel/test_mqpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


@pytest.fixture(autouse=True)
def do_something():
def set_up_target():
cudaq.set_target('nvidia-mqpu')
try:
assert cudaq.get_target().num_qpus(
Expand Down
2 changes: 1 addition & 1 deletion python/tests/remote/test_remote_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def startUpMockServer():


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/visualization/test_bloch_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


@pytest.fixture(autouse=True)
def do_something():
def run_and_clear_registries():
yield
cudaq.__clearKernelRegistries()

Expand Down
2 changes: 1 addition & 1 deletion python/tests/visualization/test_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@pytest.fixture(autouse=True)
def do_something():
def reset_run_clear():
cudaq.reset_target()
yield
cudaq.__clearKernelRegistries()
Expand Down
Loading