1
0
forked from VimPlug/jedi

change the new parser tests

This commit is contained in:
Dave Halter
2014-11-06 14:16:17 +01:00
parent aa0c73c9ab
commit 00454daf57

View File

@@ -1,22 +1,10 @@
import logging
from jedi.parser import pytree
from jedi.parser.pgen2 import Driver
from jedi.parser import Parser
def test_basic_parsing():
def compare(string):
"""Generates the AST object and then regenerates the code."""
assert d.parse_string(string).get_code() == string
#if self.options["print_function"]:
# python_grammar = pygram.python_grammar_no_print_statement
#else:
# When this is True, the refactor*() methods will call write_file() for
# files processed even if they were not changed during refactoring. If
# and only if the refactor method's write parameter was True.
logger = logging.getLogger("RefactoringTool")
d = Driver(pytree.python_grammar, convert=pytree.convert, logger=logger)
assert Parser(string).module.get_code() == string
compare('\na #pass\n')
compare('wblabla* 1\t\n')