Skip to content

Commit

Permalink
codecov - fix syntax for excluding code lines from coverage (quantuml…
Browse files Browse the repository at this point in the history
…ib#6240)

The `coverage` tool understands `# pragma: no cover` markup comments to exclude
code lines from coverage analysis.    The previous syntax `# coverage: ignore`
had no effect and resulted in spurious coverage changes for a different code
paths taken.

Removing the codecov.yml file, because coverage precision had no effect on
codecov complaints about decreased coverage.
  • Loading branch information
pavoljuhas authored Aug 15, 2023
1 parent 176578b commit d62e542
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cirq/circuits/circuit_operation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def test_repeat_zero_times(add_measurements, use_repetition_ids, initial_reps):


def test_no_repetition_ids():
def default_repetition_ids(self):
def default_repetition_ids(self): # pragma: no cover
assert False, "Should not call default_repetition_ids"

with mock.patch.object(circuit_operation, 'default_repetition_ids', new=default_repetition_ids):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,7 @@ def two_qubit_gate_product_tabulation(
# If all KAK vectors in the mesh have been tabulated, return.
missing_vec_inds = np.logical_not(tabulated_kak_inds).nonzero()[0]

if not np.any(missing_vec_inds):
# coverage: ignore
if not np.any(missing_vec_inds): # pragma: no cover
return TwoQubitGateTabulation(
base_gate, np.array(kak_vecs), sq_cycles, max_infidelity, summary, ()
)
Expand Down

0 comments on commit d62e542

Please sign in to comment.