From e4d0e3e70569667b2d2fcf748ab28133444630de Mon Sep 17 00:00:00 2001 From: Travis CI User Date: Tue, 31 Dec 2019 15:33:59 +0000 Subject: [PATCH] BF: fix for new Sphinx output format Doctest block changed. --- nb2plots/tests/test_nbplots.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/nb2plots/tests/test_nbplots.py b/nb2plots/tests/test_nbplots.py index 6d17bb4..9f3474a 100644 --- a/nb2plots/tests/test_nbplots.py +++ b/nb2plots/tests/test_nbplots.py @@ -24,6 +24,9 @@ HERE = dirname(__file__) +# Variation in doctest block. +DOCTEST_BLOCK_RE = r'' + def get_otherpage(fname): with open(pjoin(HERE, 'otherpages', fname), 'rt') as fobj: @@ -639,7 +642,7 @@ def test_pages(self): A title <nbplot_container> - <doctest_block xml:space="preserve"> + {DOCTEST_BLOCK_RE} >>> # always >>> a = 'default' <nbplot_epilogue> @@ -649,7 +652,7 @@ def test_pages(self): <paragraph> Some text <nbplot_container> - <doctest_block xml:space="preserve"> + {DOCTEST_BLOCK_RE} >>> a = 'skip is False' <nbplot_epilogue> <comment xml:space="preserve"> @@ -658,7 +661,7 @@ def test_pages(self): <paragraph> Keep text coming <nbplot_container> - <doctest_block xml:space="preserve"> + {DOCTEST_BLOCK_RE} >>> b = 'skip appears to be False' >>> a == 'skip is False' True @@ -669,10 +672,10 @@ def test_pages(self): <paragraph> Text continues <nbplot_container> - <doctest_block xml:space="preserve"> + {DOCTEST_BLOCK_RE} >>> # doctest only run when skip flag False, always rendered >>> b == 'skip appears to be False' - True""") + True""".format(**globals())) assert(regex.match(p_xml) is not None) @@ -708,7 +711,7 @@ def test_pages(self): <title> A title <nbplot_container> - <doctest_block xml:space="preserve"> + {DOCTEST_BLOCK_RE} >>> # always >>> a = 'default' <nbplot_epilogue> @@ -718,7 +721,7 @@ def test_pages(self): <paragraph> Some text <nbplot_container> - <doctest_block xml:space="preserve"> + {DOCTEST_BLOCK_RE} >>> a = 'skip is True' <nbplot_epilogue> <comment xml:space="preserve"> @@ -727,7 +730,7 @@ def test_pages(self): <paragraph> Keep text coming <nbplot_container> - <doctest_block xml:space="preserve"> + {DOCTEST_BLOCK_RE} >>> b = 'skip appears to be True' >>> a == 'skip is True' True @@ -747,10 +750,10 @@ def test_pages(self): <comment xml:space="preserve"> <comment xml:space="preserve"> <nbplot_container hide-from="all" show-to="doctest"> - <doctest_block xml:space="preserve"> + {DOCTEST_BLOCK_RE} >>> # only when skip flag True >>> b == 'skip appears to be True' - True""") + True""".format(**globals())) assert(regex.match(p_xml) is not None)