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

tests needed #2

Closed
Closed

Description

@ddfisher

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.

Activity

  1. mbdevpl commented on Dec 27, 2016

    @mbdevpl

    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?

  2. gvanrossum commented on Apr 28, 2019

    @gvanrossum
    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.

  3. gvanrossum commented on Jun 4, 2019

    @gvanrossum
    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions