Commit f7f54e2
authored
Fix test flake in pauli_string_measurement_with_readout_mitigation_test (#7459)
Avoid possible KeyError in
`test_process_pauli_measurement_results_raises_error_on_missing_calibration`
Problem: Random Pauli strings generated in the test may not contain all
qubits
as is assumed in the `empty_calibration_result_dict` key.
Solution: Make dictionary with the qubits present in Pauli strings.
Fixes spurious test failure
```
pytest --randomly-seed=532866775 \
cirq-core/cirq/contrib/paulistring/pauli_string_measurement_with_readout_mitigation_test.py \
-k test_process_pauli_measurement_results_raises_error_on_missing_calibration
```
Also fix
- unnecessarily repeated list construction
- unintentional dropping of circuits in a loop
- Nit - sync docstring with function arguments1 parent e34da07 commit f7f54e2
File tree
2 files changed
+13
-15
lines changed- cirq-core/cirq/contrib/paulistring
2 files changed
+13
-15
lines changedLines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
| 311 | + | |
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
| |||
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
329 | | - | |
| 330 | + | |
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
| |||
458 | 459 | | |
459 | 460 | | |
460 | 461 | | |
461 | | - | |
| 462 | + | |
462 | 463 | | |
463 | | - | |
| 464 | + | |
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
| |||
Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
874 | 874 | | |
875 | 875 | | |
876 | 876 | | |
877 | | - | |
| 877 | + | |
878 | 878 | | |
879 | 879 | | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
| 880 | + | |
887 | 881 | | |
888 | 882 | | |
889 | 883 | | |
890 | 884 | | |
891 | 885 | | |
892 | 886 | | |
893 | | - | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
894 | 891 | | |
895 | 892 | | |
896 | 893 | | |
| |||
0 commit comments