diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/python/parso/py3/tests/test_file_python_errors.py | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/parso/py3/tests/test_file_python_errors.py')
-rw-r--r-- | contrib/python/parso/py3/tests/test_file_python_errors.py | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/contrib/python/parso/py3/tests/test_file_python_errors.py b/contrib/python/parso/py3/tests/test_file_python_errors.py index 7083dfeb467..6c9f4307b7c 100644 --- a/contrib/python/parso/py3/tests/test_file_python_errors.py +++ b/contrib/python/parso/py3/tests/test_file_python_errors.py @@ -1,23 +1,23 @@ -import os - -import parso - - -def get_python_files(path): - for dir_path, dir_names, file_names in os.walk(path): - for file_name in file_names: - if file_name.endswith('.py'): - yield os.path.join(dir_path, file_name) - - -def test_on_itself(each_version): - """ - There are obviously no syntax erros in the Python code of parso. However - parso should output the same for all versions. - """ - grammar = parso.load_grammar(version=each_version) - path = os.path.dirname(os.path.dirname(__file__)) + '/parso' - for file in get_python_files(path): - tree = grammar.parse(path=file) - errors = list(grammar.iter_errors(tree)) - assert not errors +import os + +import parso + + +def get_python_files(path): + for dir_path, dir_names, file_names in os.walk(path): + for file_name in file_names: + if file_name.endswith('.py'): + yield os.path.join(dir_path, file_name) + + +def test_on_itself(each_version): + """ + There are obviously no syntax erros in the Python code of parso. However + parso should output the same for all versions. + """ + grammar = parso.load_grammar(version=each_version) + path = os.path.dirname(os.path.dirname(__file__)) + '/parso' + for file in get_python_files(path): + tree = grammar.parse(path=file) + errors = list(grammar.iter_errors(tree)) + assert not errors |