From 994aa6dddbe17a90003693c8f5c22222de0ac851 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 24 Oct 2024 12:17:11 +1000 Subject: [PATCH] test: sort the SVG tests by device name Fixed version of commit 4e4910d08268 ("test: sort the SVG test list") --- test/test_svg.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_svg.py b/test/test_svg.py index 5113750b..e4b10e6b 100644 --- a/test/test_svg.py +++ b/test/test_svg.py @@ -56,6 +56,10 @@ def has_item(self, id: str, classes: Optional[List[str]] = None): " " ), f"Missing class '{klass}' for {id}. Have: {node.get('class')}" + @property + def name(self): + return self.device.name + def is_autogenerated(svg_filename: Path): tabletfile = datadir() / svg_filename.name.replace(".svg", ".tablet") @@ -81,6 +85,7 @@ def pytest_generate_tests(metafunc): for d in devices if d.layout_filename ] + devices = sorted(devices, key=lambda d: d.name) def filenames(devices: List[SvgDevice]) -> List[str]: return [Path(d.device.layout_filename).name for d in devices]