From 8ec50b529301da64ee096f255c4d0b5c8dfa87c6 Mon Sep 17 00:00:00 2001 From: Chandra Sanapala Date: Thu, 12 Sep 2024 20:10:54 +0530 Subject: [PATCH] fix to use specific imports --- tests/coverage/antlr_parser/FuncTestCaseLexer.py | 9 +++++++-- .../coverage/antlr_parser/FuncTestCaseParser.py | 16 ++++++++++++++-- .../antlr_parser/FuncTestCaseParserListener.py | 2 +- .../antlr_parser/FuncTestCaseParserVisitor.py | 2 +- tests/coverage/antlr_parser/SubstraitLexer.py | 9 +++++++-- tests/coverage/test_coverage.py | 1 - 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/tests/coverage/antlr_parser/FuncTestCaseLexer.py b/tests/coverage/antlr_parser/FuncTestCaseLexer.py index 2cee7d59a..b031cacbf 100644 --- a/tests/coverage/antlr_parser/FuncTestCaseLexer.py +++ b/tests/coverage/antlr_parser/FuncTestCaseLexer.py @@ -1,6 +1,11 @@ # Generated from FuncTestCaseLexer.g4 by ANTLR 4.13.2 -from antlr4 import * -from io import StringIO +from antlr4 import ( + ATNDeserializer, + DFA, + Lexer, + LexerATNSimulator, + PredictionContextCache, +) import sys if sys.version_info[1] > 5: diff --git a/tests/coverage/antlr_parser/FuncTestCaseParser.py b/tests/coverage/antlr_parser/FuncTestCaseParser.py index f5d17b2ff..843bd9bdd 100644 --- a/tests/coverage/antlr_parser/FuncTestCaseParser.py +++ b/tests/coverage/antlr_parser/FuncTestCaseParser.py @@ -1,7 +1,19 @@ # Generated from FuncTestCaseParser.g4 by ANTLR 4.13.2 # encoding: utf-8 -from antlr4 import * -from io import StringIO +from antlr4 import ( + ATNDeserializer, + DFA, + NoViableAltException, + ParseTreeListener, + ParseTreeVisitor, + Parser, + ParserATNSimulator, + ParserRuleContext, + PredictionContextCache, + RecognitionException, + Token, + TokenStream, +) import sys if sys.version_info[1] > 5: diff --git a/tests/coverage/antlr_parser/FuncTestCaseParserListener.py b/tests/coverage/antlr_parser/FuncTestCaseParserListener.py index 830474d71..f766f77e3 100644 --- a/tests/coverage/antlr_parser/FuncTestCaseParserListener.py +++ b/tests/coverage/antlr_parser/FuncTestCaseParserListener.py @@ -1,5 +1,5 @@ # Generated from FuncTestCaseParser.g4 by ANTLR 4.13.2 -from antlr4 import * +from antlr4 import ParseTreeListener, ParseTreeVisitor if "." in __name__: from .FuncTestCaseParser import FuncTestCaseParser diff --git a/tests/coverage/antlr_parser/FuncTestCaseParserVisitor.py b/tests/coverage/antlr_parser/FuncTestCaseParserVisitor.py index 062450e8a..ddfb4af72 100644 --- a/tests/coverage/antlr_parser/FuncTestCaseParserVisitor.py +++ b/tests/coverage/antlr_parser/FuncTestCaseParserVisitor.py @@ -1,5 +1,5 @@ # Generated from FuncTestCaseParser.g4 by ANTLR 4.13.2 -from antlr4 import * +from antlr4 import ParseTreeVisitor if "." in __name__: from .FuncTestCaseParser import FuncTestCaseParser diff --git a/tests/coverage/antlr_parser/SubstraitLexer.py b/tests/coverage/antlr_parser/SubstraitLexer.py index 0b426603e..fdd6f3dba 100644 --- a/tests/coverage/antlr_parser/SubstraitLexer.py +++ b/tests/coverage/antlr_parser/SubstraitLexer.py @@ -1,6 +1,11 @@ # Generated from SubstraitLexer.g4 by ANTLR 4.13.2 -from antlr4 import * -from io import StringIO +from antlr4 import ( + ATNDeserializer, + DFA, + Lexer, + LexerATNSimulator, + PredictionContextCache, +) import sys if sys.version_info[1] > 5: diff --git a/tests/coverage/test_coverage.py b/tests/coverage/test_coverage.py index 1ec5e2d15..f4d145dc0 100644 --- a/tests/coverage/test_coverage.py +++ b/tests/coverage/test_coverage.py @@ -25,7 +25,6 @@ def test_parse_basic_example(): add(120::i8, 10::i8) [overflow:ERROR] = """ - test_str = header + tests test_file = parse_string(header + tests) assert len(test_file.testcases) == 3