Skip to content

Commit d8c1438

Browse files
committed
add ut
1 parent ab0ecf6 commit d8c1438

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

python/paddle/fluid/tests/unittests/test_imperative_basic.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,14 @@ def test_without_guard(self):
841841
y = fluid.layers.matmul(x, x)
842842

843843

844+
class TestMetaclass(unittest.TestCase):
845+
def test_metaclass(self):
846+
self.assertEqual(type(MyLayer).__name__, 'type')
847+
self.assertNotEqual(type(MyLayer).__name__, 'pybind11_type')
848+
self.assertEqual(
849+
type(paddle.fluid.core.VarBase).__name__, 'pybind11_type')
850+
851+
844852
if __name__ == '__main__':
845853
paddle.enable_static()
846854
unittest.main()

0 commit comments

Comments
 (0)