File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 66import timing
77import typed_astunparse
88
9- from transpyle .general .code_reader import CodeReader
10- from transpyle .c .parser import C99Parser
11- from transpyle .c .ast_generalizer import CAstGeneralizer
9+ try :
10+ from transpyle .c .ast_generalizer import CAstGeneralizer
11+ except ImportError :
12+ pass
13+ try :
14+ from transpyle .c .parser import C99Parser
15+ except ImportError :
16+ pass
17+ from transpyle .general import AstGeneralizer , CodeReader , Parser
1218
1319from .common import basic_check_c_ast , basic_check_python_ast , execute_on_language_examples
1420
1723_TIME = timing .get_timing_group (__name__ )
1824
1925
26+ @unittest .skipIf (Parser .find ('C' ) is None , 'skipping due to missing C language support' )
2027class ParserTests (unittest .TestCase ):
2128
2229 @execute_on_language_examples ('c11' )
@@ -30,6 +37,7 @@ def test_parse_examples(self, input_path):
3037 _LOG .info ('parsed "%s" in %fs' , input_path , timer .elapsed )
3138
3239
40+ @unittest .skipIf (AstGeneralizer .find ('C' ) is None , 'skipping due to missing C language support' )
3341class AstGeneralizerTests (unittest .TestCase ):
3442
3543 @execute_on_language_examples ('c11' )
You can’t perform that action at this time.
0 commit comments