…mock (GH-16784) (#18166)
If an autospecced object is attached using attach_mock the
child would be a function with mock object as attribute from
which signature has to be derived.
(cherry picked from commit 66b00a9)
Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>