Automate patching an attribute using monkeypatch.setattr in pytest
Preconditions (2)
Step 1: Create a test function using pytest
Step 2: Use monkeypatch.setattr to replace the target function or attribute with a mock or dummy function/value
Step 3: Call the function under test that uses the patched attribute
Step 4: Verify the output or behavior reflects the patched attribute
✅ Expected Result: The test passes confirming the attribute was successfully patched and the function behaves as expected