Skip to content

Commit 831e3c6

Browse files
committed
Run 'make patchcheck' and black
1 parent 4c02d3b commit 831e3c6

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Lib/test/test_peg_generator/test_c_parser.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from test import support
99
from test.support.script_helper import assert_python_ok
1010

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"):
1313
from pegen.grammar_parser import GeneratedParser as GrammarParser
1414
from pegen.testutil import (
1515
parse_string,
@@ -62,7 +62,7 @@ class TestCParser(TempdirManager, unittest.TestCase):
6262
def setUp(self):
6363
cmd = support.missing_compiler_executable()
6464
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)
6666
super(TestCParser, self).setUp()
6767
self.tmp_path = self.mkdtemp()
6868
change_cwd = support.change_cwd(self.tmp_path)
@@ -79,11 +79,11 @@ def build_extension(self, grammar_source):
7979

8080
def run_test(self, grammar_source, test_source):
8181
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+
)
8787

8888
def test_c_parser(self) -> None:
8989
grammar_source = """
@@ -389,7 +389,6 @@ def test_headers_and_trailer(self) -> None:
389389
self.assertTrue("SOME SUBHEADER" in parser_source)
390390
self.assertTrue("SOME TRAILER" in parser_source)
391391

392-
393392
def test_error_in_rules(self) -> None:
394393
grammar_source = """
395394
start: expr+ NEWLINE? ENDMARKER
@@ -401,4 +400,3 @@ def test_error_in_rules(self) -> None:
401400
parse.parse_string("a", mode=0)
402401
"""
403402
self.run_test(grammar_source, test_source)
404-

0 commit comments

Comments
 (0)