You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 5, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 5, 2023. It is now read-only.
I don't know if it helps, but since I'm developing an unparser for typed AST (called typed-astunparse), I wrote a test suite that does round-trip parse-unparse for some examples with type comments, as well as stdlib. They all pass with Python 3.5, however fail with 3.6 due to the fact that f-strings are now used by stdlib in 3.6.
And also, astunparse, on which I'm relying heavily in my implementation, has a comprehensive set of round-trip unit tests.
In both above modules, the tests cover both parse-unparse, as well as comparison of AST dumps. In the former, I also do some comparison between typed and untyped trees, and check if round-trip result using built-in ast parser is the same as typed_ast for cases with no type comments.
Let me know if anything of the above sounds helpful.
What do you think should be the next concrete step towards testing typed_ast?
I created some tests for ast3, in ast3/tests. These are far from comprehensive, though, and there are no tests for ast27. Someone could perhaps adapt the ast3 tests to ast27 and add them to ast27/tests.
There are also some Python 2.7 tests (in the same file, ast3/tests/test_basics.py). I think that's all we can hope for. For new features we'll add tests.
Activity
mbdevpl commentedon Dec 27, 2016
I don't know if it helps, but since I'm developing an unparser for typed AST (called
typed-astunparse), I wrote a test suite that does round-trip parse-unparse for some examples with type comments, as well as stdlib. They all pass with Python 3.5, however fail with 3.6 due to the fact that f-strings are now used by stdlib in 3.6.And also,
astunparse, on which I'm relying heavily in my implementation, has a comprehensive set of round-trip unit tests.In both above modules, the tests cover both parse-unparse, as well as comparison of AST dumps. In the former, I also do some comparison between typed and untyped trees, and check if round-trip result using built-in ast parser is the same as typed_ast for cases with no type comments.
Let me know if anything of the above sounds helpful.
What do you think should be the next concrete step towards testing typed_ast?
gvanrossum commentedon Apr 28, 2019
I created some tests for ast3, in ast3/tests. These are far from comprehensive, though, and there are no tests for ast27. Someone could perhaps adapt the ast3 tests to ast27 and add them to ast27/tests.
gvanrossum commentedon Jun 4, 2019
There are also some Python 2.7 tests (in the same file,
ast3/tests/test_basics.py). I think that's all we can hope for. For new features we'll add tests.