summaryrefslogtreecommitdiff
path: root/astroid/tests/unittest_nodes.py
Commit message (Collapse)AuthorAgeFilesLines
* Moved tests out of package directory (#704)Ashley Whetter2019-10-151-1220/+0
|
* All type comments have as parent the corresponding `astroid` nodeClaudiu Popa2019-10-091-0/+21
| | | | | | | Until now they had as parent the builtin `ast` node which meant we were operating with primitive objects instead of our own. Close PyCQA/pylint#3174
* Remove redundant compatibility code (#693)Hugo van Kemenade2019-09-101-18/+6
|
* Fix typed_ast based tests for Python 3.8Claudiu Popa2019-07-101-2/+8
|
* Run f string debug test on Python 3.8+Claudiu Popa2019-07-101-0/+1
|
* Add a simple test for f-string debug modeClaudiu Popa2019-07-101-0/+6
|
* Add support for finding positional only arguments using the Arguments APIsClaudiu Popa2019-07-091-0/+15
|
* Grab only Constant strings for docstringsClaudiu Popa2019-07-061-0/+9
|
* Add test for extracting a doc to make sure we have it working on Python 3.8Claudiu Popa2019-07-061-0/+11
|
* Add support for Python 3.8's `NamedExpr` nodes, which is part of assignment ↵Claudiu Popa2019-06-011-0/+25
| | | | | | expressions. Close #674
* Can access per argument type comments (#667)Ashley Whetter2019-05-141-0/+39
| | | Close #665
* Skip test on Windows to get rid of a false positiveClaudiu Popa2019-03-201-1/+6
|
* Initial formatting of astroidClaudiu Popa2018-10-021-211/+273
|
* Reflect AST changes in Python 3.8.Serhiy Storchaka2018-09-301-4/+4
| | | | | | | | * Num, Str, Bytes, Ellipsis and NameConstant are replaced with Constant. (https://bugs.python.org/issue32892) * Index is replaced with its value, ExtSlice is replaced with Tuple. (https://bugs.python.org/issue34822)
* pytest why are you being so weird? add missing reason keyword argumentClaudiu Popa2018-09-231-1/+1
|
* Use skipif instead of the missing skipunless and remove test for pygtkClaudiu Popa2018-09-231-2/+2
|
* Correct line numbering for f-strings for complex embedded expressionsClaudiu Popa2018-09-231-0/+14
| | | | | | | | | | When a f-string contained a complex expression, such as an attribute access, we weren't cloning all the subtree of the f-string expression for attaching the correct line number. This problem is coming from the builtin AST parser which gives for the f-string and for its underlying elements the line number 1, but this is causing all sorts of bugs and problems in pylint, which expects correct line numbering. Close PyCQA/pylint#2449
* `async` functions are now inferred as `AsyncGenerator` when inferring their ↵Claudiu Popa2018-08-161-0/+35
| | | | call result.
* Make sure that assign nodes can find ``yield`` statements in their valuesClaudiu Popa2018-08-101-0/+16
| | | | Close PyCQA/pylint#2400
* Fix unused importClaudiu Popa2018-07-191-1/+1
|
* Check if we actually have typed_ast installed and skip the tests that need itClaudiu Popa2018-07-171-5/+5
| | | | Close #596
* Update the copyright noticesastroid-2.0Claudiu Popa2018-07-151-2/+10
|
* Add a ChangeLog entry for the as_string() improvements and remove readlines callClaudiu Popa2018-07-051-1/+1
|
* Improve as_string output of operators, elif, with, return & docsbrendanator2018-07-051-2/+25
| | | | | | | | | | | | | The precedence and associativity rules of operators are respected and parens are only wrapped around child nodes when needed A single If node inside the else block is output as `elif` Unneccesary parens in with statements are removed Unneccesary parens in tuple returns are removed Doc strings in classes and functions no longer get additional indenting
* Fix lintClaudiu Popa2018-07-031-0/+1
|
* Prevent Const copy resulting in recursionBryce Guinta2018-06-231-0/+8
| | | | | | | | | | | | Calling object.__new__ on a Const node would result in infinite recursion Fix infinite recursion by explicitly raising AttributeError if __getattr__ is called for value See https://nedbatchelder.com/blog/201010/surprising_getattr_recursion.html for more details Close #565
* Fix pylint errorsClaudiu Popa2018-06-041-1/+1
|
* Add support for parsing function type commentsClaudiu Popa2018-06-041-0/+49
| | | | | | This commit exposes two new attributes to the FunctionDef nodes, type_comment_args respectively type_comment_annotations. These two attributes hold the type annotations provided via type comments.
* Fix the operator, this should have been the other way aroundClaudiu Popa2018-05-241-1/+1
|
* kill aliases scheduled for removalClaudiu Popa2018-05-241-61/+8
|
* Add support for type comments (#548)Claudiu Popa2018-05-231-0/+62
|
* pyupgrade (#549)Anthony Sottile2018-05-221-1/+1
|
* Add _namespace_packages to pkg_resources brain tip and fix the lint errorsClaudiu Popa2018-03-301-1/+0
|
* add qname to Unknown node to avoid error in pylintBryce Guinta2018-03-261-0/+1
|
* Add name attribute to Unknown classBryce Guinta2018-03-261-0/+7
| | | | | | This allows .root().name calls to work for Unknown objects Close #523
* Fix lint warningsClaudiu Popa2017-10-121-0/+6
|
* Add support for Python 3.6's annotated assignment nodesrr-2017-02-091-0/+47
|
* Make is_argument search kwonlyargs. (#386)Derek Gustafson2017-01-221-0/+9
|
* Remove flaky test.Claudiu Popa2016-11-211-8/+0
|
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-221-2/+6
|
* Keep a consistent copyright notice across the board.Claudiu Popa2016-07-191-0/+2
|
* New function, astroid.extract_node, exported out from astroid.test_utils.Claudiu Popa2016-06-291-14/+14
|
* Fix typosJakub Wilk2016-06-021-1/+1
|
* Convert all files to new license headerCeridwen2016-05-161-17/+3
|
* Add a new possible property-descriptor, lazy.Claudiu Popa2015-12-211-1/+5
| | | | | | | | | Since we don't understand descriptors at all, we're relying on a list of possible property-descriptors, that is, decorators which transforms a method into its value, the exact process that a property does. While this is a bad approach, it works, at least until we can provide support for this high level of understanding. Closes #279
* Cleanup pylint's warnings over astroid codebaseClaudiu Popa2015-12-141-20/+20
| | | | | | | | | | Some of the messages were disabled in pylintrc, since they're not very useful for our case. Other parameters, such as the number of arguments / statements / attributes etc were configured so that they won't be too restrictive for our codebase, since making the code to respect them right now requires too much development changes, which is not justified by the end result. Closes issue #284.
* Enable the warnings in tests through a context managerClaudiu Popa2015-12-111-10/+11
| | | | | | | | Previously, we were enabling blindly all the warnings in tests files through `warnings.simplefilter`, which had the side effect of not taking into account the values of the -W flag. This meant that warnings which should have been silenced, weren't, leading to a huge output when running the tests with Python 3.5.
* Some nodes got a new attribute, 'ctx', which tells in which context the said ↵Claudiu Popa2015-12-081-0/+50
| | | | | | | | | | | | | | | | | | | node was used. The possible values for the contexts are `Load` ('a'), `Del` ('del a'), `Store` ('a = 4') and the nodes that got the new attribute are Starred, Subscript, List and Tuple. The builtin ast module provides contexts for Name and Attribute as well, but we took a different approach in the past, by having different nodes for each type of context. For instance, Name used in a Del context is a DelName, while Name used in a Store context is AssignName. Since this is ingrained in astroid since quite some time, it makes no sense to change them as well, even though it's a loss of consistency. The patch introduces a new dependency to enum34 on older Python versions, which is used for building the three possible enum values for the contexts. Closes issue #267.
* AstroidBuildingException is now AstroidBuildingError.Claudiu Popa2015-12-061-1/+1
| | | | The first name will exist until astroid 2.0.
* Add support for handling Uninferable nodes when calling as_stringClaudiu Popa2015-11-291-0/+10
| | | | | | | | | | Some object, for instance List or Tuple can have, after inference, Uninferable as their elements, happening when their components weren't couldn't be inferred properly. This means that as_string needs to cope with expecting Uninferable nodes part of the other nodes coming for a string transformation. The patch adds a visit method in AsString and ``accept`` on Yes / Uninferable nodes. Closes issue #270.