[Python-checkins] bpo-40334: Suppress all output in test_peg_generator (GH-19675)
Lysandros Nikolaou
webhook-mailer at python.org
Thu Apr 23 08:22:36 EDT 2020
https://github.com/python/cpython/commit/8d1cbfffea7a5dbf7a3c60b066a2c2120ef08cd0
commit: 8d1cbfffea7a5dbf7a3c60b066a2c2120ef08cd0
branch: master
author: Lysandros Nikolaou <lisandrosnik at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-04-23T13:22:16+01:00
summary:
bpo-40334: Suppress all output in test_peg_generator (GH-19675)
files:
M Lib/test/test_peg_generator/test_c_parser.py
M Lib/test/test_peg_generator/test_pegen.py
diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py
index f2f699c83df01..6682c907cda2a 100644
--- a/Lib/test/test_peg_generator/test_c_parser.py
+++ b/Lib/test/test_peg_generator/test_c_parser.py
@@ -295,7 +295,6 @@ def test_syntax_error_for_string(self) -> None:
expr: NAME
"""
grammar = parse_string(grammar_source, GrammarParser)
- print(list(Path(self.tmp_path).iterdir()))
extension = generate_parser_c_extension(grammar, Path(self.tmp_path))
for text in ("a b 42 b a", "名 名 42 名 名"):
try:
diff --git a/Lib/test/test_peg_generator/test_pegen.py b/Lib/test/test_peg_generator/test_pegen.py
index 581c7acd337e4..0a2a6d4ae1601 100644
--- a/Lib/test/test_peg_generator/test_pegen.py
+++ b/Lib/test/test_peg_generator/test_pegen.py
@@ -81,7 +81,6 @@ def test_repeat_with_separator_rules(self) -> None:
"""
rules = parse_string(grammar, GrammarParser).rules
self.assertEqual(str(rules["start"]), "start: ','.thing+ NEWLINE")
- print(repr(rules["start"]))
self.assertTrue(repr(rules["start"]).startswith(
"Rule('start', None, Rhs([Alt([NamedItem(None, Gather(StringLeaf(\"','\"), NameLeaf('thing'"
))
@@ -511,7 +510,7 @@ def test_cut(self) -> None:
expr: NUMBER
"""
parser_class = make_parser(grammar)
- node = parse_string("(1)", parser_class, verbose=True)
+ node = parse_string("(1)", parser_class)
self.assertEqual(node, [
TokenInfo(OP, string="(", start=(1, 0), end=(1, 1), line="(1)"),
[TokenInfo(NUMBER, string="1", start=(1, 1), end=(1, 2), line="(1)")],
@@ -695,8 +694,6 @@ def test_deep_nested_rule(self) -> None:
printer.print_grammar_ast(rules, printer=lines.append)
output = "\n".join(lines)
- print()
- print(output)
expected_output = textwrap.dedent(
"""\
└──Rule
More information about the Python-checkins
mailing list