Instagram / Instagram/LibCST

test_parse_error for native parser

Open
#1,179 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.9k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

I've been taking a look at https://github.com/Instagram/LibCST/issues/1112#issue-2156871432 and struggled a bit getting the tests to reproduce the error, although it was easy to reproduce from a file.

I found this line:
https://github.com/Instagram/LibCST/blame/e20e757159f435417fb4d3a0913264c7d252b847/libcst/_parser/tests/test_parse_errors.py#L177
filters out anything other than a check if the error thrown is a `SyntaxError` when using the native parser, so we lose granularity of testing the error string itself.

Since the errors are different between the native and pure parser, the error messages in this test class will need to be rewritten to match the native output.

A couple of questions:
1. Is my above understanding correct? :) I might have missed if the native parser is tested elsewhere in the codebase.
2. Do we prefer rewriting the file to test just for the output of the native parser, or should we duplicate the tests to test for both native and pure output?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.