From 32086f7c837b0f14fdad3af055105bff9286a6f3 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Fri, 6 Jan 2017 16:37:36 +0100 Subject: [PATCH] tests: update ipnbdoctest to graphviz 2.40 and Python 3.6 This fix recent failures observed on arch linux because it uses newer versions of graphviz and Python. * tests/python/ipnbdoctest.py (sanitize): More substitutions. --- tests/python/ipnbdoctest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/python/ipnbdoctest.py b/tests/python/ipnbdoctest.py index 6acd80499..d5c405c23 100755 --- a/tests/python/ipnbdoctest.py +++ b/tests/python/ipnbdoctest.py @@ -94,6 +94,20 @@ def sanitize(s): s = re.sub(r'transform="[^"]*"', 'transform=""', s) s = re.sub(r'id="edge[^"]*"', 'id="edge"', s) s = re.sub(r'text-anchor="[^"]*"', 'text-anchor=""', s) + # The following patterns from graphviz 2.40 are rewritten as they used to + # be in 2.38. + s = re.sub(r'"#000000"', '"black"', s) + s = re.sub(r'"#ffffff"', '"white"', s) + s = re.sub(r'"#00ff00"', '"green"', s) + s = re.sub(r'"#ff0000"', '"red"', s) + s = re.sub(r'"#c0c0c0"', '"grey"', s) + s = re.sub(r'"#ffa500"', '"orange"', s) + s = re.sub(r' fill="black"', '', s) + s = re.sub(r' stroke="transparent"', ' stroke="none"', s) + s = re.sub(r'>', '>\n<title>', s) + + # CalledProcessError message has a final dot in Python 3.6 + s = re.sub(r"(' returned non-zero exit status \d+)\.", r'\1', s) return s