Allow unit test to parse testcase blocks

When a unittest introspect a meson.build file from a test case,
the file may contain a testcase block. We should ignore this block.
This commit is contained in:
Charles Brunet 2023-09-08 08:47:27 -04:00 committed by Nirbheek Chauhan
parent d2dfef5205
commit 8caf40e5ae
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,7 @@ from ..interpreterbase import (
InvalidArguments,
BreakRequest,
ContinueRequest,
Disabler,
default_resolve_key,
)
@ -53,6 +54,7 @@ from ..mparser import (
NotNode,
PlusAssignmentNode,
TernaryNode,
TestCaseClauseNode,
)
if T.TYPE_CHECKING:
@ -444,3 +446,6 @@ class AstInterpreter(InterpreterBase):
elif isinstance(val, (str, bool, int, float)) or include_unknown_args:
flattened_kwargs[key] = val
return flattened_kwargs
def evaluate_testcase(self, node: TestCaseClauseNode) -> Disabler | None:
return Disabler(subproject=self.subproject)