Repository: quantumlib/Cirq

Issue:
Failing test in clifford_simulator_test
**Description of the issue**
I encounter a failing test on my local machine.

**How to reproduce the issue**
Run `pytest` in a fresh virtual environment. My Python version is 3.8.4rc1. I get the following failing test:

```
____________________________________________ test_deprecated ____________________________________________

    def test_deprecated():
        q = cirq.LineQubit(0)
        clifford_state = cirq.CliffordState({q: 0})
        with cirq.testing.assert_logs('wave_function', 'state_vector',
                                      'deprecated'):
            _ = clifford_state.wave_function()
    
        with cirq.testing.assert_logs('collapse_wave_function',
                                      'collapse_state_vector', 'deprecated'):
            # pylint: disable=unexpected-keyword-arg,no-value-for-parameter
>           _ = clifford_state.perform_measurement([q],
                                                   prng=0,
                                                   collapse_wave_function=True)

sim/clifford/clifford_simulator_test.py:505: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Handler (NOTSET)>, exc_type = None, exc_val = None, exc_tb = None

    def __exit__(self, exc_type, exc_val, exc_tb):
        logging.getLogger().removeHandler(self)
        if capture_warnings:
            logging.captureWarnings(False)
        assert len(records) == count, (
            f'Expected {count} log message but got {len(records)}.')
        msgs = [record.getMessage() for record in records]
        for match in matches:
>           assert match in ''.join(msgs), (
                f'{match} expected to appear in log messages but it was '
                f'not found. Logs messages: {msgs}.')
E           AssertionError: collapse_wave_function expected to appear in log messages but it was not found. Logs messages: ['/home/sungkevin/Projects/Cirq/cirq/sim/clifford/clifford_simulator_test.py:505: DeprecationWarning: The collapse_wavefunction parameter of CliffordState.perform_measurement was used but is deprecated.\nIt will be removed in cirq v0.10.0.\nUse collapse_state_vector instead.\n\n  _ = clifford_state.perform_measurement([q],\n'].

testing/logs.py:77: AssertionError
```

**Cirq version**
0.9.0.dev



Discussion:

Resolving patch:
diff --git a/cirq/sim/clifford/clifford_simulator.py b/cirq/sim/clifford/clifford_simulator.py
--- a/cirq/sim/clifford/clifford_simulator.py
+++ b/cirq/sim/clifford/clifford_simulator.py
@@ -428,9 +428,9 @@ def _apply_Y(self, qubit: int):
         deadline='v0.10.0',
         fix='Use collapse_state_vector instead.',
         parameter_desc='collapse_wavefunction',
-        match=lambda args, kwargs: 'collapse_wave_function' in kwargs,
-        rewrite=lambda args, kwargs: (args, {(
-            'collapse_state_vector' if k == 'collapse_wave_function' else k): v
+        match=lambda args, kwargs: 'collapse_wavefunction' in kwargs,
+        rewrite=lambda args, kwargs: (args, {('collapse_state_vector' if k ==
+                                              'collapse_wavefunction' else k): v
                                              for k, v in kwargs.items()}))
     def perform_measurement(self,
                             qubits: Sequence[ops.Qid],


Test patch:
diff --git a/cirq/sim/clifford/clifford_simulator_test.py b/cirq/sim/clifford/clifford_simulator_test.py
--- a/cirq/sim/clifford/clifford_simulator_test.py
+++ b/cirq/sim/clifford/clifford_simulator_test.py
@@ -499,9 +499,9 @@ def test_deprecated():
                                   'deprecated'):
         _ = clifford_state.wave_function()
 
-    with cirq.testing.assert_logs('collapse_wave_function',
+    with cirq.testing.assert_logs('collapse_wavefunction',
                                   'collapse_state_vector', 'deprecated'):
         # pylint: disable=unexpected-keyword-arg,no-value-for-parameter
         _ = clifford_state.perform_measurement([q],
                                                prng=0,
-                                               collapse_wave_function=True)
+                                               collapse_wavefunction=True)