File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,33 @@ def test_batch_error(*args):
20
20
Chain (5 , 6.1 )
21
21
.rydberg .detuning .uniform .linear (- 10 , 10 , 3.0 )
22
22
.quera .mock ()
23
- .run (100 )
23
+ .run_async (100 )
24
+ )
25
+
26
+ error_files = glob .glob ("partial-batch-errors-*" )
27
+ batch_files = glob .glob ("partial-batch-future-*" )
28
+
29
+ assert len (error_files ) == 1
30
+ assert len (batch_files ) == 1
31
+
32
+ for error_file , batch_file in zip (error_files , batch_files ):
33
+ os .remove (error_file )
34
+ os .remove (batch_file )
35
+
36
+
37
+ @patch ("bloqade.ir.routine.quera.MockBackend" )
38
+ def test_batch_warn (* args ):
39
+ backend = bloqade .ir .routine .quera .MockBackend ()
40
+
41
+ backend .submit_task .side_effect = ValueError ("some random error" )
42
+ backend .dict .return_value = {"state_file" : ".mock_state.txt" }
43
+
44
+ with pytest .warns ():
45
+ (
46
+ Chain (5 , 6.1 )
47
+ .rydberg .detuning .uniform .linear (- 10 , 10 , 3.0 )
48
+ .quera .mock ()
49
+ .run_async (100 , ignore_submission_error = True )
24
50
)
25
51
26
52
error_files = glob .glob ("partial-batch-errors-*" )
You can’t perform that action at this time.
0 commit comments