diff --git a/gdb-port/tests/unit/top-level-parse.py b/gdb-port/tests/unit/top-level-parse.py
index 48b17d18eef334fc4eeb7cc0be77df7217a4c9a2..199fdb65e6d1a1168e75dd269168d5e9ab76507d 100644
--- a/gdb-port/tests/unit/top-level-parse.py
+++ b/gdb-port/tests/unit/top-level-parse.py
@@ -87,7 +87,7 @@ class TopLevelParseStateManagement(unittest.TestCase):
 		self.top_level_parse.parser_objs[32] = self.parser1
 		self.top_level_parse.enter_h_do_parse(16, self._arena, self.parser1.address)
 		self.top_level_parse.enter_h_arena_malloc_raw(256)
-		self.assertEqual(self.parser1.bytes_used[int(self._arena)], 256)
+		self.assertEqual(self.parser1.bytes_used.get(int(self._arena), None), 256)
 
 	# 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")