class_docstr: Tests for the counts function
docstr: Test that a ValueError is raised if both an observable is provided and wires are
  specified
docstr_tok: ["Test","that","a","ValueError","is","raised","if","both","an","observable","is","provided","and","wires","are","specified"]
code: def test_providing_observable_and_wires(self):
      """Test that a ValueError is raised if both an observable is provided and wires are
      specified"""
  
      with pytest.raises(
          ValueError,
          match="Cannot specify the wires to sample if an observable is provided."
          " The wires to sample will be determined directly from the observable.",
      ):
          qml.counts(qml.PauliZ(0), wires=[0, 1])
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane.measurements import AllCounts, Counts, CountsMP
  from pennylane.wires import Wires
label_desc: Use image node_id 4 for calling the TestCounts obj's underlying member method code with example usage: obj.test_providing_observable_and_wires() without return types