summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@users.noreply.github.com>2020-06-27 16:14:35 -0500
committerPaul McGuire <ptmcg@users.noreply.github.com>2020-06-27 16:14:35 -0500
commit78b46d17a7091d0909411a899dd5984128278877 (patch)
tree94b5b3a126088b4eb700cc1573468306c1f22b6d
parent837586497a7ebc73aa99f72b9b09701052342da2 (diff)
downloadpyparsing-git-78b46d17a7091d0909411a899dd5984128278877.tar.gz
Assert packrat not enabled in base test case; log packrat status and cache type in all cases
-rw-r--r--tests/test_unit.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_unit.py b/tests/test_unit.py
index 8bfbb56..5b5d391 100644
--- a/tests/test_unit.py
+++ b/tests/test_unit.py
@@ -101,6 +101,10 @@ class Test2_WithoutPackrat(ppt.TestParseResultsAsserts, TestCase):
)
return ar
+ def test000_assert_packrat_status(self):
+ print("Packrat enabled:", ParserElement._packratEnabled)
+ self.assertFalse(ParserElement._packratEnabled, "packrat enabled")
+
def testUpdateDefaultWhitespace(self):
prev_default_whitespace_chars = pp.ParserElement.DEFAULT_WHITE_CHARS
@@ -7768,6 +7772,12 @@ class Test4_WithPackrat(Test2_WithoutPackrat):
"""
def test000_assert_packrat_status(self):
+ print("Packrat enabled:", ParserElement._packratEnabled)
+ print(
+ "Packrat cache:",
+ type(ParserElement.packrat_cache).__name__,
+ getattr(ParserElement.packrat_cache, "size", "- no size attribute -"),
+ )
self.assertTrue(ParserElement._packratEnabled, "packrat not enabled")
self.assertEqual(
"_FifoCache",
@@ -7793,6 +7803,12 @@ class Test6_WithBoundedPackrat(Test2_WithoutPackrat):
"""
def test000_assert_packrat_status(self):
+ print("Packrat enabled:", ParserElement._packratEnabled)
+ print(
+ "Packrat cache:",
+ type(ParserElement.packrat_cache).__name__,
+ getattr(ParserElement.packrat_cache, "size", "- no size attribute -"),
+ )
self.assertTrue(ParserElement._packratEnabled, "packrat not enabled")
self.assertEqual(
"_FifoCache",
@@ -7818,6 +7834,12 @@ class Test8_WithUnboundedPackrat(Test2_WithoutPackrat):
"""
def test000_assert_packrat_status(self):
+ print("Packrat enabled:", ParserElement._packratEnabled)
+ print(
+ "Packrat cache:",
+ type(ParserElement.packrat_cache).__name__,
+ getattr(ParserElement.packrat_cache, "size", "- no size attribute -"),
+ )
self.assertTrue(ParserElement._packratEnabled, "packrat not enabled")
self.assertEqual(
"_UnboundedCache",