return _inspect.getmembers(object, predicate)
+def getmodule(object): # pylint: disable=redefined-builtin
+ """TFDecorator-aware replacement for inspect.getmodule."""
+ return _inspect.getmodule(object)
+
+
def getmro(cls):
"""TFDecorator-aware replacement for inspect.getmro."""
return _inspect.getmro(cls)
inspect.getmembers(TestDecoratedClass),
tf_inspect.getmembers(TestDecoratedClass))
+ def testGetModule(self):
+ self.assertEqual(
+ inspect.getmodule(TestDecoratedClass),
+ tf_inspect.getmodule(TestDecoratedClass))
+ self.assertEqual(
+ inspect.getmodule(test_decorated_function),
+ tf_inspect.getmodule(test_decorated_function))
+ self.assertEqual(
+ inspect.getmodule(test_undecorated_function),
+ tf_inspect.getmodule(test_undecorated_function))
+
def testGetSource(self):
expected = '''@test_decorator('decorator')
def test_decorated_function_with_defaults(a, b=2, c='Hello'):