From 678edd94d8a6dfb5d51f9c3549e6ee8c90a73744 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 19 Mar 2022 17:37:32 +0100 Subject: [PATCH] tests: allow a different default document unit for SVGSurface It was changed upstream, despite being documented. See https://gitlab.freedesktop.org/cairo/cairo/-/issues/545 --- tests/test_surface.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_surface.py b/tests/test_surface.py index 20f1bd4a..503bc50e 100644 --- a/tests/test_surface.py +++ b/tests/test_surface.py @@ -267,7 +267,10 @@ def test_svg_version_to_string(): reason="too old cairo") def test_svg_surface_get_document_unit(): with cairo.SVGSurface(None, 10, 10) as surface: - assert surface.get_document_unit() == cairo.SVGUnit.PT + # https://gitlab.freedesktop.org/cairo/cairo/-/issues/545 + assert surface.get_document_unit() in [cairo.SVGUnit.PT, cairo.SVGUnit.USER] + + with cairo.SVGSurface(None, 10, 10) as surface: surface.set_document_unit(cairo.SVGUnit.PX) assert surface.get_document_unit() == cairo.SVGUnit.PX with pytest.raises(cairo.Error):