SF.net SVN: docutils:[9818 ] trunk/docutils/test/test _io.py

aa-turner--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9818
          http://sourceforge.net/p/docutils/code/9818
Author:   aa-turner
Date:     2024-08-01 17:35:31 +0000 (Thu, 01 Aug 2024)
Log Message:
-----------
Mark ``test_fallback_no_utf8`` as an expected failure

Modified Paths:
--------------
    trunk/docutils/test/test_io.py

Modified: trunk/docutils/test/test_io.py
===================================================================
--- trunk/docutils/test/test_io.py	2024-08-01 17:24:14 UTC (rev 9817)
+++ trunk/docutils/test/test_io.py	2024-08-01 17:35:31 UTC (rev 9818)
@@ -42,7 +42,13 @@
     preferredencoding = codecs.lookup(
         locale.getpreferredencoding(do_setlocale=False)).name
 
+if preferredencoding in {'cp1252', 'iso8859-1'}:
+    expected_failure_on_non_utf8 = unittest.expectedFailure
+else:
+    def expected_failure_on_non_utf8(test_item):
+        return test_item
 
+
 # Stub: Buffer with 'strict' auto-conversion of input to byte string:
 class BBuf(BytesIO):
     def write(self, data):
@@ -309,6 +315,9 @@
             source_path=os.path.join(DATA_ROOT, 'utf8.txt'))
         self.assertEqual('Grüße\n', source.read())
 
+    # Failing on non-UTF-8 locales (with UTF-8 mode disabled):
+    # see https://sourceforge.net/p/docutils/bugs/490/#43b7
+    @expected_failure_on_non_utf8
     @unittest.skipIf(preferredencoding in (None, 'ascii', 'utf-8'),
                      'locale encoding not set or UTF-8')
     def test_fallback_no_utf8(self):

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



_______________________________________________
Docutils-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-checkins
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.