summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/unittest_python3.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unittest_python3.py b/test/unittest_python3.py
index 761fbcff..0102c323 100644
--- a/test/unittest_python3.py
+++ b/test/unittest_python3.py
@@ -69,5 +69,17 @@ class Python3TC(TestCase):
self.assertIsInstance(metaclass, Class)
self.assertEqual(metaclass.name, 'ABCMeta')
+ @require_version('3.0')
+ def test_as_string(self):
+ body = dedent("""
+ from abc import ABCMeta
+ class Test(metaclass=ABCMeta): pass""")
+ astroid = self.builder.string_build(body)
+ klass = astroid.body[1]
+
+ self.assertEqual(klass.as_string(),
+ '\n\nclass Test(metaclass=ABCMeta):\n pass\n')
+
+
if __name__ == '__main__':
unittest_main()