diff options
-rw-r--r-- | pyparsing/testing.py | 4 | ||||
-rw-r--r-- | tests/test_unit.py | 24 |
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 |