8
8
from test import support
9
9
from test .support .script_helper import assert_python_ok
10
10
11
- test_tools .skip_if_missing (' peg_generator' )
12
- with test_tools .imports_under_tool (' peg_generator' ):
11
+ test_tools .skip_if_missing (" peg_generator" )
12
+ with test_tools .imports_under_tool (" peg_generator" ):
13
13
from pegen .grammar_parser import GeneratedParser as GrammarParser
14
14
from pegen .testutil import (
15
15
parse_string ,
@@ -62,7 +62,7 @@ class TestCParser(TempdirManager, unittest.TestCase):
62
62
def setUp (self ):
63
63
cmd = support .missing_compiler_executable ()
64
64
if cmd is not None :
65
- self .skipTest (' The %r command is not found' % cmd )
65
+ self .skipTest (" The %r command is not found" % cmd )
66
66
super (TestCParser , self ).setUp ()
67
67
self .tmp_path = self .mkdtemp ()
68
68
change_cwd = support .change_cwd (self .tmp_path )
@@ -79,11 +79,11 @@ def build_extension(self, grammar_source):
79
79
80
80
def run_test (self , grammar_source , test_source ):
81
81
self .build_extension (grammar_source )
82
- test_source = textwrap .indent (textwrap .dedent (test_source ), 8 * ' ' )
83
- assert_python_ok ("-c" , TEST_TEMPLATE . format (
84
- extension_path = self . tmp_path ,
85
- test_source = test_source
86
- ))
82
+ test_source = textwrap .indent (textwrap .dedent (test_source ), 8 * " " )
83
+ assert_python_ok (
84
+ "-c" ,
85
+ TEST_TEMPLATE . format ( extension_path = self . tmp_path , test_source = test_source ),
86
+ )
87
87
88
88
def test_c_parser (self ) -> None :
89
89
grammar_source = """
@@ -389,7 +389,6 @@ def test_headers_and_trailer(self) -> None:
389
389
self .assertTrue ("SOME SUBHEADER" in parser_source )
390
390
self .assertTrue ("SOME TRAILER" in parser_source )
391
391
392
-
393
392
def test_error_in_rules (self ) -> None :
394
393
grammar_source = """
395
394
start: expr+ NEWLINE? ENDMARKER
@@ -401,4 +400,3 @@ def test_error_in_rules(self) -> None:
401
400
parse.parse_string("a", mode=0)
402
401
"""
403
402
self .run_test (grammar_source , test_source )
404
-
0 commit comments