From 38e26892f2b0d4d72ccb2e4e54f4f06c537e0ddb Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 18 Feb 2015 12:50:26 +0100 Subject: [PATCH] The fast parser doesn't work with open parentheses properly, document that. --- test/test_parser/test_fast_parser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test_parser/test_fast_parser.py b/test/test_parser/test_fast_parser.py index b7eb369c..f1023011 100644 --- a/test/test_parser/test_fast_parser.py +++ b/test/test_parser/test_fast_parser.py @@ -329,7 +329,12 @@ def test_open_parentheses(): # get_code, because it isn't valid code. assert p.module.get_code() == '\n' + func assert p.number_of_splits == 2 - assert p.number_parsers_used == 2 + # CAVEAT: There are multiple splits, but because of the open parentheses, + # we just use one parser. We could theoretically break at the `def`, + # however that would require to also break properly at flow level. That is + # not possible because of ternary statements and would lead to strange + # behavior without much more knowledge. So we just keep it this way. + assert p.number_parsers_used == 1 def test_incomplete_function():