multiple adjustments for Debian stable

* tests/python/ipnbdoctest.py: Adjust to Python <3.6.
* tests/python/_autparserr.ipynb: Adjust to older IPython version.
* tests/python/stutter-inv.ipynb: Avoid pandas because its output
varies from version to version.
This commit is contained in:
Alexandre Duret-Lutz 2018-01-20 11:30:10 +01:00
parent 527c802511
commit 1fd0aa14a2
3 changed files with 138 additions and 718 deletions

View file

@ -6,6 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import display\n",
"import spot\n",
"spot.setup()"
]
@ -27,7 +28,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting _example.aut\n"
"Writing _example.aut\n"
]
}
],
@ -111,7 +112,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fbec845de70> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f72fc2978d0> >"
]
},
"metadata": {},
@ -183,7 +184,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fbec846c5a0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f72fc2ce090> >"
]
},
"execution_count": 4,
@ -309,7 +310,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fbec846c570> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f72fc2ce5a0> >"
]
},
"metadata": {},

View file

@ -115,12 +115,9 @@ def canonicalize(s, type, ignores):
s = re.sub(r' fill="black"', '', s)
s = re.sub(r' stroke="transparent"', ' stroke="none"', s)
s = re.sub(r'><title>', '>\n<title>', s)
# Different Pandas versions produce different CSS styles.
s = re.sub(r'<style[ a-z]*>.*</style>',
'<style>...</style>', s, flags=re.DOTALL)
# CalledProcessError message has a final dot in Python 3.6
s = re.sub(r"(' returned non-zero exit status \d+)\.", r'\1', s)
# Different Pandas versions produce different CSS styles (when there is a
# style).
s = re.sub(r'<style[ a-z]*>.*</style>\n', '', s, flags=re.DOTALL)
for n, p in enumerate(ignores):
s = re.sub(p, 'IGN{}'.format(n), s)
@ -145,6 +142,12 @@ def canonical_dict(dict, ignores):
# sys.exit(77) is used to Skip the test.
sys.exit(77)
if 'ename' in dict and dict['ename'] == 'CalledProcessError':
# CalledProcessError message has a final dot in Python 3.6
dict['evalue'] = \
re.sub(r"(' returned non-zero exit status \d+)\.", r'\1',
dict['evalue'])
if 'transient' in dict:
del dict['transient']
if 'execution_count' in dict:

File diff suppressed because it is too large Load diff