Safely unwrap objects and determine if they are functions.
(self, obj)
| 1004 | raise ValueError("object must be a class or function") |
| 1005 | |
| 1006 | def _is_routine(self, obj): |
| 1007 | """ |
| 1008 | Safely unwrap objects and determine if they are functions. |
| 1009 | """ |
| 1010 | maybe_routine = obj |
| 1011 | try: |
| 1012 | maybe_routine = inspect.unwrap(maybe_routine) |
| 1013 | except ValueError: |
| 1014 | pass |
| 1015 | return inspect.isroutine(maybe_routine) |
| 1016 | |
| 1017 | def _find(self, tests, obj, name, module, source_lines, globs, seen): |
| 1018 | """ |