Safely unwrap objects and determine if they are functions.
(self, obj)
| 977 | raise ValueError("object must be a class or function") |
| 978 | |
| 979 | def _is_routine(self, obj): |
| 980 | """ |
| 981 | Safely unwrap objects and determine if they are functions. |
| 982 | """ |
| 983 | maybe_routine = obj |
| 984 | try: |
| 985 | maybe_routine = inspect.unwrap(maybe_routine) |
| 986 | except ValueError: |
| 987 | pass |
| 988 | return inspect.isroutine(maybe_routine) |
| 989 | |
| 990 | def _find(self, tests, obj, name, module, source_lines, globs, seen): |
| 991 | """ |