code: def test_invalid_gradient_method():
      """Tests that unknown gradient_methods raise a ValueError."""
      with pytest.raises(
          ValueError, match="gradient_method must be in"
      ):
          _ = ExecutionConfig(gradient_method="nonsense")
  
imports: import pytest
  from pennylane.devices import ExecutionConfig
label_desc: Use image node_id 3 for calling a global function with example usage: test_invalid_gradient_method() without return types