Returns a mapping of all objects with the wrong __module__ attribute.
(module, module_name=None)
| 18 | |
| 19 | |
| 20 | def check_dir(module, module_name=None): |
| 21 | """Returns a mapping of all objects with the wrong __module__ attribute.""" |
| 22 | if module_name is None: |
| 23 | module_name = module.__name__ |
| 24 | results = {} |
| 25 | for name in dir(module): |
| 26 | item = getattr(module, name) |
| 27 | if (hasattr(item, '__module__') and hasattr(item, '__name__') |
| 28 | and item.__module__ != module_name): |
| 29 | results[name] = item.__module__ + '.' + item.__name__ |
| 30 | return results |
| 31 | |
| 32 | |
| 33 | def test_numpy_namespace(): |
no outgoing calls
no test coverage detected