Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

tests needed #2

Closed
ddfisher opened this issue Feb 27, 2016 · 3 comments
Closed

tests needed #2

ddfisher opened this issue Feb 27, 2016 · 3 comments

Comments

@ddfisher
Copy link
Collaborator

Once this is fully integrated with mypy, we can run the mypy tests to check that things are being parsed correctly.

It may be also worth checking if CPython has tests for the AST module we can use.

@mbdevpl
Copy link

mbdevpl commented 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
Copy link
Member

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
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants