Skip to content

Commit

Permalink
fix: drop task count for batch task tests to 3 (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeCoull authored Nov 1, 2023
1 parent fdad0f1 commit 163867f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions test/unit_tests/braket/aws/test_aws_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,7 @@ def test_get_devices_simulators_only(mock_copy_session, aws_session):
assert [result.name for result in results] == ["SV1"]


@pytest.mark.filterwarnings("ignore:Test Code:")
@patch("braket.aws.aws_device.AwsSession.copy_session")
def test_get_devices_with_error_in_region(mock_copy_session, aws_session):
aws_session.search_devices.side_effect = [
Expand Down
10 changes: 5 additions & 5 deletions test/unit_tests/braket/devices/test_local_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def test_batch_circuit():
theta = FreeParameter("theta")
task = Circuit().rx(angle=theta, target=0)
device = LocalSimulator(dummy)
num_tasks = 10
num_tasks = 3
circuits = [task for _ in range(num_tasks)]
inputs = [{"theta": i} for i in range(num_tasks)]
batch = device.run_batch(circuits, inputs=inputs, shots=10)
Expand All @@ -329,7 +329,7 @@ def test_batch_with_max_parallel():
dummy = DummyProgramSimulator()
task = Circuit().h(0).cnot(0, 1)
device = LocalSimulator(dummy)
num_tasks = 10
num_tasks = 3
circuits = [task for _ in range(num_tasks)]
batch = device.run_batch(circuits, shots=10, max_parallel=2)
assert len(batch.results()) == num_tasks
Expand All @@ -341,7 +341,7 @@ def test_batch_with_annealing_problems():
dummy = DummyAnnealingSimulator()
problem = Problem(ProblemType.ISING)
device = LocalSimulator(dummy)
num_tasks = 10
num_tasks = 3
problems = [problem for _ in range(num_tasks)]
batch = device.run_batch(problems, shots=10)
assert len(batch.results()) == num_tasks
Expand All @@ -353,7 +353,7 @@ def test_batch_circuit_without_inputs():
dummy = DummyProgramSimulator()
bell = Circuit().h(0).cnot(0, 1)
device = LocalSimulator(dummy)
num_tasks = 10
num_tasks = 3
circuits = [bell for _ in range(num_tasks)]
batch = device.run_batch(circuits, shots=10)
assert len(batch.results()) == num_tasks
Expand Down Expand Up @@ -385,7 +385,7 @@ def test_batch_circuit_with_task_and_input_mismatch():
dummy = DummyProgramSimulator()
bell = Circuit().h(0).cnot(0, 1)
device = LocalSimulator(dummy)
num_tasks = 10
num_tasks = 3
circuits = [bell for _ in range(num_tasks)]
inputs = [{} for _ in range(num_tasks - 1)]
with pytest.raises(ValueError):
Expand Down

0 comments on commit 163867f

Please sign in to comment.