def METHOD_NAME(self):
    class TestClass:
        def __init__(self):
            self.lock = MagicMock()
        @synchronized
        def test_function(self):
            return True
    test_class = TestClass()
    with patch.object(test_class, "lock"):
        test_class.test_function()