def test_version(): cairo.cairo_version() cairo.cairo_version_string() assert cairo.CAIRO_VERSION == cairo.cairo_version() assert cairo.CAIRO_VERSION_STRING == cairo.cairo_version_string() ver_tuple = (cairo.CAIRO_VERSION_MAJOR, cairo.CAIRO_VERSION_MINOR, cairo.CAIRO_VERSION_MICRO) assert tuple(map(int, cairo.CAIRO_VERSION_STRING.split("."))) == \ ver_tuple
def test_version(): cairo.cairo_version() cairo.cairo_version_string()
'PdfWriter', 'ExpandV3XmlWriter', ] try: import weasyprint HAVE_WEASYPRINT = True except (ImportError, OSError, ValueError): weasyprint = False HAVE_WEASYPRINT = False try: import cairo HAVE_PYCAIRO = True except (ImportError, OSError): cairo = False HAVE_PYCAIRO = False try: from weasyprint.text import cairo HAVE_CAIRO = True CAIRO_VERSION = cairo.cairo_version() except (ImportError, OSError): HAVE_CAIRO = False CAIRO_VERSION = None try: from weasyprint.text import pango HAVE_PANGO = True PANGO_VERSION = pango.pango_version except (ImportError, OSError, AttributeError): HAVE_PANGO = False PANGO_VERSION = None