Fix handling of tests which check constants
Because of how the parser works, it does not differentiate between constants and function names, so this needs to convert it back.
This commit is contained in:
parent
e5d018fdef
commit
23a145dc2d
@ -558,6 +558,14 @@ def parse_conditional_expression_test(ast):
|
||||
kwargs = call.kwargs
|
||||
dynamic_args = call.dyn_args
|
||||
dynamic_kwargs = call.dyn_kwargs
|
||||
elif isinstance(test_function, nodes.Const):
|
||||
const_map = {
|
||||
None: 'none',
|
||||
True: 'true',
|
||||
False: 'false',
|
||||
}
|
||||
|
||||
name = const_map[test_function.value]
|
||||
else:
|
||||
name = test_function.name
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user