def _test_processor(processor: cg.engine.abstract_processor.AbstractProcessor) -> None:
    """Tests an engine instance with some standard commands.
    Also tests the non-Sycamore qubits and gates fail."""
    good_qubit = cirq.GridQubit(5, 4)
    circuit = cirq.Circuit(cirq.X(good_qubit), cirq.measure(good_qubit))
    results = processor.run(circuit, repetitions=100, run_name="run", device_config_name="config")
    assert np.all(results.measurements[str(good_qubit)] == 1)
    with pytest.raises(RuntimeError, match='requested total repetitions'):
        _ = processor.run(
            circuit, repetitions=100_000_000, run_name="run", device_config_name="config"
        )

    bad_qubit = cirq.GridQubit(1000, 1000)
    circuit = cirq.Circuit(cirq.X(bad_qubit), cirq.measure(bad_qubit))
    with pytest.raises(ValueError, match='Qubit not on device'):
        _ = processor.run(circuit, repetitions=100, run_name="run", device_config_name="config")
    circuit = cirq.Circuit(
        cirq.testing.DoesNotSupportSerializationGate()(good_qubit), cirq.measure(good_qubit)
    )
    with pytest.raises(ValueError, match='Cannot serialize op'):
        _ = processor.run(circuit, repetitions=100, run_name="run", device_config_name="config")
Tests an engine instance with some standard commands.
    Also tests the non-Sycamore qubits and gates fail.
cirq-google/cirq_google/engine/virtual_engine_factory_test.py