Python Programming - Testing

Exercise : Testing - General Questions
  • Testing - General Questions
76.
What does the unittest.mock.patch.object decorator do in Python testing?
Decorates a test method with a patch for an object attribute
Skips a test method based on a condition
Marks a test as skipped
Adds a setup function to be run before the test method
Answer: Option
Explanation:
The unittest.mock.patch.object decorator is used to decorate a test method with a patch for an object attribute in Python testing.