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