This is a pretty technical internal detail of how cirq works.
Basically what's going on is that cirq's continuous integration system verifies test coverage. If you contribute to cirq and you touch a line of code, there's supposed to be at least one test that runs that line (or else an # coverage: ignore
annotation on the line). The "only touched lines matter" nature of this check makes it possible for uncovered lines to exist (e.g. by changes that delete tests without touching the lines that become uncovered, or by grandfathered lines that existed before the coverage check), so the coverage of the project is not 100%. The coverage check is more of a "give me evidence that you actually tried this" check when adding code.
Anyways, in that particular PR the coverage check is complaining that a line is not being tested. This line is tricky to actually hit, because it's explicitly about a case not being handled. (The line is raise TypeError(f'Unsupported operation: {op!r}')
). Often these lines aren't even reachable. They're just defensive programming ensuring that if this internal method is called incorrectly that it will stop instead of charging forward making things worse and more confusing. In normal situations the method is simply called correctly.
The correct fix in this situation is not to cover the line (generally you don't want to assert for all time that a particular case must not work) but to annotate the line as not covered. Actually, one of the built-in escape valves for the coverage check is that any line throwing a NotImplementedError
doesn't need to be covered, so really only the type of exception being raised needs to change.