summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/delta_time.py6
-rw-r--r--tests/test_unit.py9
2 files changed, 10 insertions, 5 deletions
diff --git a/examples/delta_time.py b/examples/delta_time.py
index 9eceacf..5ceff1b 100644
--- a/examples/delta_time.py
+++ b/examples/delta_time.py
@@ -145,9 +145,9 @@ time_units = hour | minute | second
relative_time_reference = (
qty("qty") + time_units("units") + ago("dir")
| qty("qty")
- + time_units("units")
- + (from_ | before | after)("dir")
- + pp.Group(absolute_time_of_day)("ref_time")
+ + time_units("units")
+ + (from_ | before | after)("dir")
+ + pp.Group(absolute_time_of_day)("ref_time")
| in_("dir") + qty("qty") + time_units("units")
)
diff --git a/tests/test_unit.py b/tests/test_unit.py
index db3f4a3..149150d 100644
--- a/tests/test_unit.py
+++ b/tests/test_unit.py
@@ -6752,20 +6752,25 @@ class Test2_WithoutPackrat(ppt.TestParseResultsAsserts, TestCase):
def testParseExpressionsWithRegex(self):
from itertools import product
+
match_empty_regex = pp.Regex(r"[a-z]*")
match_nonempty_regex = pp.Regex(r"[a-z]+")
parser_classes = pp.ParseExpression.__subclasses__()
test_string = "abc def"
expected = ["abc"]
- for expr, cls in product((match_nonempty_regex, match_empty_regex), parser_classes):
+ for expr, cls in product(
+ (match_nonempty_regex, match_empty_regex), parser_classes
+ ):
print(expr, cls)
parser = cls([expr])
parsed_result = parser.parseString(test_string)
print(parsed_result.dump())
self.assertParseResultsEquals(parsed_result, expected)
- for expr, cls in product((match_nonempty_regex, match_empty_regex), (pp.MatchFirst, pp.Or)):
+ for expr, cls in product(
+ (match_nonempty_regex, match_empty_regex), (pp.MatchFirst, pp.Or)
+ ):
parser = cls([expr, expr])
print(parser)
parsed_result = parser.parseString(test_string)