diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2023-04-17 20:26:50 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2023-04-17 20:26:50 +0000 |
| commit | 4a869f3c77f9f17e470c5d47956e1dba1aa742bf (patch) | |
| tree | c9bde33acd85e4c9de6db5fa384e7b5aabbad167 /test | |
| parent | 537ba2f5c03ab60a4f60e05ef81c2c3567569a04 (diff) | |
| download | docutils-4a869f3c77f9f17e470c5d47956e1dba1aa742bf.tar.gz | |
Raise ValueError if StringOutput.write() gets data of unsupported type
... instead of returning/storing an "informal string representation".
Replaces the test for the "odt" writers" with binary output in
`core.publish_programmatically()` with a generic alternative
(that also catches the case of the "null" writer instead of writing
the string "None").
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9353 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test')
| -rwxr-xr-x | test/test_publisher.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/test_publisher.py b/test/test_publisher.py index 9911163bf..16c0e0e31 100755 --- a/test/test_publisher.py +++ b/test/test_publisher.py @@ -150,10 +150,8 @@ class PublisherTests(unittest.TestCase): TODO: return `str` with document as "flat XML" (.fodt). """ with self.assertRaises(ValueError) as cm: - core.publish_string('test', - writer_name='odt', - auto_encode=False) - self.assertIn('ODT writer generates binary output', str(cm.exception)) + core.publish_string('test', writer_name='odt', auto_encode=False) + self.assertIn('expects `str` instance', str(cm.exception)) class PublishDoctreeTestCase(unittest.TestCase, docutils.SettingsSpec): |
