diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-29 16:36:31 +0200 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-29 16:36:31 +0200 |
commit | e7a408bd3a78599d9af2661cf6d045c859e55272 (patch) | |
tree | ea04fd6f6416d7ef961848c652a7a5012acc7873 | |
parent | 981df422e0996db7d0b54ac8cdfa7a5dfc972552 (diff) | |
download | astroid-e7a408bd3a78599d9af2661cf6d045c859e55272.tar.gz |
Mark an unimplemented test as an expected failure.
Do this in order to be visible that something is not implemented
and it is expected to fail.
-rw-r--r-- | astroid/tests/unittest_nodes.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/astroid/tests/unittest_nodes.py b/astroid/tests/unittest_nodes.py index 725f996..c8b2ee8 100644 --- a/astroid/tests/unittest_nodes.py +++ b/astroid/tests/unittest_nodes.py @@ -20,6 +20,7 @@ import os import sys import unittest +import textwrap from astroid.node_classes import unpack_infer from astroid.bases import BUILTINS, InferenceContext @@ -80,18 +81,24 @@ def function(var): except NameError as nexc: (*hell, o) = b'hello' raise AttributeError from nexc -\n''' - # TODO : annotations and keywords for class definition are not yet implemented - _todo = ''' -def function(var:int): - nonlocal counter - -class Language(metaclass=Natural): - """natural language""" - ''' +\n''' ast = abuilder.string_build(code) self.assertEqual(ast.as_string(), code) + @test_utils.require_version('3.0') + @unittest.expectedFailure + def test_3k_annotations_and_metaclass(self): + code_annotations = textwrap.dedent(''' + def function(var:int): + nonlocal counter + + class Language(metaclass=Natural): + """natural language""" + ''') + + ast = abuilder.string_build(code_annotations) + self.assertEqual(ast.as_string(), code_annotations) + def test_ellipsis(self): ast = abuilder.string_build('a[...]').body[0] self.assertEqual(ast.as_string(), 'a[...]') |