From 90981d22360b22b8ad0466921a18df034b94a4ef Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 14 Apr 2023 16:07:53 +0200 Subject: [PATCH] Clean PROPER_CHILDREN --- tests/testing_utils.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/testing_utils.py b/tests/testing_utils.py index d0577f3fa..ae41fd07d 100644 --- a/tests/testing_utils.py +++ b/tests/testing_utils.py @@ -29,21 +29,21 @@ os.path.dirname(__file__), '..', 'weasyprint', 'css', 'tests_ua.css' )) -PROPER_CHILDREN = dict((key, tuple(map(tuple, value))) for key, value in { +PROPER_CHILDREN = { # Children can be of *any* type in *one* of the lists. - boxes.BlockContainerBox: [[boxes.BlockLevelBox], [boxes.LineBox]], - boxes.LineBox: [[boxes.InlineLevelBox]], - boxes.InlineBox: [[boxes.InlineLevelBox]], - boxes.TableBox: [[boxes.TableCaptionBox, - boxes.TableColumnGroupBox, boxes.TableColumnBox, - boxes.TableRowGroupBox, boxes.TableRowBox]], - boxes.InlineTableBox: [[boxes.TableCaptionBox, - boxes.TableColumnGroupBox, boxes.TableColumnBox, - boxes.TableRowGroupBox, boxes.TableRowBox]], - boxes.TableColumnGroupBox: [[boxes.TableColumnBox]], - boxes.TableRowGroupBox: [[boxes.TableRowBox]], - boxes.TableRowBox: [[boxes.TableCellBox]], -}.items()) + boxes.BlockContainerBox: ((boxes.BlockLevelBox,), (boxes.LineBox,)), + boxes.LineBox: ((boxes.InlineLevelBox,),), + boxes.InlineBox: ((boxes.InlineLevelBox,),), + boxes.TableBox: (( + boxes.TableCaptionBox, boxes.TableColumnGroupBox, boxes.TableColumnBox, + boxes.TableRowGroupBox, boxes.TableRowBox),), + boxes.InlineTableBox: (( + boxes.TableCaptionBox, boxes.TableColumnGroupBox, boxes.TableColumnBox, + boxes.TableRowGroupBox, boxes.TableRowBox),), + boxes.TableColumnGroupBox: ((boxes.TableColumnBox,),), + boxes.TableRowGroupBox: ((boxes.TableRowBox,),), + boxes.TableRowBox: ((boxes.TableCellBox,),), +} class FakeHTML(HTML):