From 07fe944644bfca9d2540ec53b84ba0a1cf8e51bb 2013-09-03 17:22:06 From: Thomas Kluyver Date: 2013-09-03 17:22:06 Subject: [PATCH] Remove ParametricTestCase from nbconvert tests --- diff --git a/IPython/nbconvert/filters/tests/test_ansi.py b/IPython/nbconvert/filters/tests/test_ansi.py index c6d9d17..e24c10c 100644 --- a/IPython/nbconvert/filters/tests/test_ansi.py +++ b/IPython/nbconvert/filters/tests/test_ansi.py @@ -39,7 +39,7 @@ class TestAnsi(TestsBase): 'hello' : 'hello'} for inval, outval in correct_outputs.items(): - yield self._try_strip_ansi(inval, outval) + self._try_strip_ansi(inval, outval) def _try_strip_ansi(self, inval, outval): @@ -58,7 +58,7 @@ class TestAnsi(TestsBase): 'hello' : 'hello'} for inval, outval in correct_outputs.items(): - yield self._try_ansi2html(inval, outval) + self._try_ansi2html(inval, outval) def _try_ansi2html(self, inval, outval): @@ -77,7 +77,7 @@ class TestAnsi(TestsBase): 'hello' : 'hello'} for inval, outval in correct_outputs.items(): - yield self._try_ansi2latex(inval, outval) + self._try_ansi2latex(inval, outval) def _try_ansi2latex(self, inval, outval): diff --git a/IPython/nbconvert/filters/tests/test_highlight.py b/IPython/nbconvert/filters/tests/test_highlight.py index 04f9107..df25a42 100644 --- a/IPython/nbconvert/filters/tests/test_highlight.py +++ b/IPython/nbconvert/filters/tests/test_highlight.py @@ -49,13 +49,13 @@ class TestHighlight(TestsBase): def test_highlight2html(self): """highlight2html test""" for index, test in enumerate(self.tests): - yield self._try_highlight(highlight2html, test, self.tokens[index]) + self._try_highlight(highlight2html, test, self.tokens[index]) def test_highlight2latex(self): """highlight2latex test""" for index, test in enumerate(self.tests): - yield self._try_highlight(highlight2latex, test, self.tokens[index]) + self._try_highlight(highlight2latex, test, self.tokens[index]) def _try_highlight(self, method, test, tokens): diff --git a/IPython/nbconvert/filters/tests/test_latex.py b/IPython/nbconvert/filters/tests/test_latex.py index ae2914c..282e3c9 100644 --- a/IPython/nbconvert/filters/tests/test_latex.py +++ b/IPython/nbconvert/filters/tests/test_latex.py @@ -35,7 +35,7 @@ class TestLatex(TestsBase): ('','')] for test in tests: - yield self._try_escape_latex(test[0], test[1]) + self._try_escape_latex(test[0], test[1]) def _try_escape_latex(self, test, result): @@ -56,7 +56,7 @@ class TestLatex(TestsBase): ('','')] for test in tests: - yield self._try_strip_math_space(test[0], test[1]) + self._try_strip_math_space(test[0], test[1]) def _try_strip_math_space(self, test, result): diff --git a/IPython/nbconvert/filters/tests/test_markdown.py b/IPython/nbconvert/filters/tests/test_markdown.py index d0b5b3c..54e100a 100644 --- a/IPython/nbconvert/filters/tests/test_markdown.py +++ b/IPython/nbconvert/filters/tests/test_markdown.py @@ -61,14 +61,14 @@ class TestMarkdown(TestsBase): def test_markdown2latex(self): """markdown2latex test""" for index, test in enumerate(self.tests): - yield self._try_markdown(markdown2latex, test, self.tokens[index]) + self._try_markdown(markdown2latex, test, self.tokens[index]) @dec.onlyif_cmds_exist('pandoc') def test_markdown2html(self): """markdown2html test""" for index, test in enumerate(self.tests): - yield self._try_markdown(markdown2html, test, self.tokens[index]) + self._try_markdown(markdown2html, test, self.tokens[index]) @dec.onlyif_cmds_exist('pandoc') @@ -81,7 +81,7 @@ class TestMarkdown(TestsBase): tokens[1] = r'\*\*test' for index, test in enumerate(self.tests): - yield self._try_markdown(markdown2rst, test, tokens[index]) + self._try_markdown(markdown2rst, test, tokens[index]) def _try_markdown(self, method, test, tokens): diff --git a/IPython/nbconvert/filters/tests/test_strings.py b/IPython/nbconvert/filters/tests/test_strings.py index f0739c3..cb3cbdf 100644 --- a/IPython/nbconvert/filters/tests/test_strings.py +++ b/IPython/nbconvert/filters/tests/test_strings.py @@ -36,7 +36,7 @@ class TestStrings(TestsBase): As if the strings were thine, shouldst know of this. """ for length in [30,5,1]: - yield self._confirm_wrap_text(test_text, length) + self._confirm_wrap_text(test_text, length) def _confirm_wrap_text(self, text, length): @@ -73,7 +73,7 @@ class TestStrings(TestsBase): ('Hello', 'Hello'), ('W$o$rld', 'W$o$rld')] for test in tests: - yield self._try_strip_dollars(test[0], test[1]) + self._try_strip_dollars(test[0], test[1]) def _try_strip_dollars(self, test, result): @@ -89,7 +89,7 @@ class TestStrings(TestsBase): ('My files are in `files/`', 'My files are in `files/`'), ('files/test.html', 'files/test.html')] for test in tests: - yield self._try_files_prefix(test[0], test[1]) + self._try_files_prefix(test[0], test[1]) def _try_files_prefix(self, test, result): diff --git a/IPython/nbconvert/tests/base.py b/IPython/nbconvert/tests/base.py index 81df37b..c84cde8 100644 --- a/IPython/nbconvert/tests/base.py +++ b/IPython/nbconvert/tests/base.py @@ -16,12 +16,12 @@ Contains base test class for nbconvert import os import glob import shutil +import unittest import IPython from IPython.utils.tempdir import TemporaryWorkingDirectory from IPython.utils.process import get_output_error_code from IPython.testing.tools import get_ipython_cmd -from IPython.testing.ipunittest import ParametricTestCase # a trailing space allows for simpler concatenation with the other arguments ipy_cmd = get_ipython_cmd(as_string=True) + " " @@ -31,7 +31,7 @@ ipy_cmd = get_ipython_cmd(as_string=True) + " " #----------------------------------------------------------------------------- -class TestsBase(ParametricTestCase): +class TestsBase(unittest.TestCase): """Base tests class. Contains useful fuzzy comparison and nbconvert functions.""" @@ -86,7 +86,7 @@ class TestsBase(ParametricTestCase): For example: Replace "ii" with "i" in the string "Hiiii" yields "Hii" - Another replacement yields "Hi" (the desired output) + Another replacement cds "Hi" (the desired output) Parameters: -----------