From 861d866a931f1414a7aeeb3c47f6f489ba18de98 Mon Sep 17 00:00:00 2001
From: pompolic <pompolic@special-circumstanc.es>
Date: Mon, 8 May 2023 20:59:27 +0200
Subject: [PATCH] Fix unittest.skipIf decorator

---
 gdb-port/tests/unit/top-level-parse.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb-port/tests/unit/top-level-parse.py b/gdb-port/tests/unit/top-level-parse.py
index cb1c5d0..376381c 100644
--- a/gdb-port/tests/unit/top-level-parse.py
+++ b/gdb-port/tests/unit/top-level-parse.py
@@ -89,7 +89,8 @@ class TopLevelParseStateManagement(unittest.TestCase):
 		self.top_level_parse.enter_h_arena_malloc_raw(256)
 		self.assertEqual(self.parser1.bytes_used[int(self._arena.address)], 256)
 
-	@skipIf(self.top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS)
+	# A bit hacky: relying on the top_level_parse initialized by top-level-parse.py, because we have no reference to the testcase
+	@unittest.skipIf(top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS, "malloc-based allocation counts disabled")
 	def test_enter_h_arena_malloc_raw(self):
 		self.top_level_parse.parser_stacks.append(self.ps1)
 		self.top_level_parse.parser_objs[32] = self.parser1
-- 
GitLab