diff options
| author | aa-turner <aa-turner@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-11-08 16:50:35 +0000 |
|---|---|---|
| committer | aa-turner <aa-turner@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-11-08 16:50:35 +0000 |
| commit | 2511b1a11e742be94bb5742b891272a4983f3379 (patch) | |
| tree | b8b1e4d71753b274a94e655d6a2472b156cd1b99 /docutils/test/DocutilsTestSupport.py | |
| parent | b97e552ab75dc4c6c91c5dfe5cefd564e6672bbb (diff) | |
| download | docutils-2511b1a11e742be94bb5742b891272a4983f3379.tar.gz | |
Inline ``GridTableParserTestSuite``
- Move all usages of ``GridTableParserTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9224 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/DocutilsTestSupport.py')
| -rw-r--r-- | docutils/test/DocutilsTestSupport.py | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index bf51026fc..0ee2b8190 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -20,8 +20,6 @@ Exports the following: - `ParserTestSuite` - `PEPParserTestCase` - `PEPParserTestSuite` - - `GridTableParserTestCase` - - `GridTableParserTestSuite` - `WriterPublishTestCase` - `PublishTestSuite` """ @@ -362,61 +360,6 @@ class PEPParserTestSuite(ParserTestSuite): test_case_class = PEPParserTestCase -class GridTableParserTestCase(CustomTestCase): - - parser = tableparser.GridTableParser() - - def test_parse_table(self): - self.parser.setup(StringList(string2lines(self.input), 'test data')) - try: - self.parser.find_head_body_sep() - self.parser.parse_table() - output = self.parser.cells - except Exception as details: - output = '%s: %s' % (details.__class__.__name__, details) - self.assertEqual(pformat(output), - pformat(self.expected)) - - def test_parse(self): - try: - output = self.parser.parse(StringList(string2lines(self.input), - 'test data')) - except Exception as details: - output = '%s: %s' % (details.__class__.__name__, details) - self.assertEqual(pformat(output), - pformat(self.expected)) - - -class GridTableParserTestSuite(CustomTestSuite): - - """ - A collection of GridTableParserTestCases. - - A GridTableParserTestSuite instance manufactures GridTableParserTestCases, - keeps track of them, and provides a shared test fixture (a-la setUp and - tearDown). - """ - - def generateTests(self, dict): - """ - Stock the suite with test cases generated from a test data dictionary. - - Each dictionary key (test type name) maps to a list of tests. Each - test is a list: an input table, expected output from parse_table(), - expected output from parse(). - Tests should be self-documenting and not require external comments. - """ - for name, cases in dict.items(): - for casenum, (case_input, case_table, - case_expected) in enumerate(cases): - self.addTestCase(GridTableParserTestCase, 'test_parse_table', - input=case_input, expected=case_table, - id=f'totest[{name!r}][{casenum}]') - self.addTestCase(GridTableParserTestCase, 'test_parse', - input=case_input, expected=case_expected, - id=f'totest[{name!r}][{casenum}]') - - class WriterPublishTestCase(CustomTestCase, docutils.SettingsSpec): """ |
