summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2020-06-26 02:02:48 -0500
committerptmcg <ptmcg@austin.rr.com>2020-06-26 02:02:48 -0500
commit347689044bddffcab7a6408e25072dad03dee800 (patch)
tree60986f88c44acd9c2280ca9b26da2acceb15102a
parentc4435b9072dad0436bae008eac748e0f1e003345 (diff)
downloadpyparsing-git-347689044bddffcab7a6408e25072dad03dee800.tar.gz
Blackening
-rw-r--r--pyparsing/testing.py4
-rw-r--r--tests/test_unit.py24
2 files changed, 21 insertions, 7 deletions
diff --git a/pyparsing/testing.py b/pyparsing/testing.py
index a6add20..86623b9 100644
--- a/pyparsing/testing.py
+++ b/pyparsing/testing.py
@@ -53,7 +53,9 @@ class pyparsing_test:
self._save_context["packrat_enabled"] = ParserElement._packratEnabled
if ParserElement._packratEnabled:
- self._save_context["packrat_cache_size"] = ParserElement.packrat_cache.size
+ self._save_context[
+ "packrat_cache_size"
+ ] = ParserElement.packrat_cache.size
else:
self._save_context["packrat_cache_size"] = None
self._save_context["packrat_parse"] = ParserElement._parse
diff --git a/tests/test_unit.py b/tests/test_unit.py
index 09fea37..8bfbb56 100644
--- a/tests/test_unit.py
+++ b/tests/test_unit.py
@@ -7766,10 +7766,14 @@ class Test4_WithPackrat(Test2_WithoutPackrat):
"""
rerun Test2 tests, now that packrat is enabled
"""
+
def test000_assert_packrat_status(self):
self.assertTrue(ParserElement._packratEnabled, "packrat not enabled")
- self.assertEqual("_FifoCache", type(ParserElement.packrat_cache).__name__,
- msg="incorrect cache type")
+ self.assertEqual(
+ "_FifoCache",
+ type(ParserElement.packrat_cache).__name__,
+ msg="incorrect cache type",
+ )
class Test5_EnableBoundedPackratParsing(TestCase):
@@ -7787,10 +7791,14 @@ class Test6_WithBoundedPackrat(Test2_WithoutPackrat):
"""
rerun Test2 tests, now with bounded packrat cache
"""
+
def test000_assert_packrat_status(self):
self.assertTrue(ParserElement._packratEnabled, "packrat not enabled")
- self.assertEqual("_FifoCache", type(ParserElement.packrat_cache).__name__,
- msg="incorrect cache type")
+ self.assertEqual(
+ "_FifoCache",
+ type(ParserElement.packrat_cache).__name__,
+ msg="incorrect cache type",
+ )
class Test7_EnableUnboundedPackratParsing(TestCase):
@@ -7808,10 +7816,14 @@ class Test8_WithUnboundedPackrat(Test2_WithoutPackrat):
"""
rerun Test2 tests, now with unbounded packrat cache
"""
+
def test000_assert_packrat_status(self):
self.assertTrue(ParserElement._packratEnabled, "packrat not enabled")
- self.assertEqual("_UnboundedCache", type(ParserElement.packrat_cache).__name__,
- msg="incorrect cache type")
+ self.assertEqual(
+ "_UnboundedCache",
+ type(ParserElement.packrat_cache).__name__,
+ msg="incorrect cache type",
+ )
# force clear of packrat parsing flags before saving contexts