[Python-checkins] r85763 - python/branches/py3k/Lib/test/test_cmd_line.py

victor.stinner python-checkins at python.org
Wed Oct 20 23:56:55 CEST 2010


Author: victor.stinner
Date: Wed Oct 20 23:56:55 2010
New Revision: 85763

Log:
Move non-ascii test from test_run_code() to a new function: test_non_ascii()


Modified:
   python/branches/py3k/Lib/test/test_cmd_line.py

Modified: python/branches/py3k/Lib/test/test_cmd_line.py
==============================================================================
--- python/branches/py3k/Lib/test/test_cmd_line.py	(original)
+++ python/branches/py3k/Lib/test/test_cmd_line.py	Wed Oct 20 23:56:55 2010
@@ -99,14 +99,16 @@
         # All good if execution is successful
         assert_python_ok('-c', 'pass')
 
+    @unittest.skipIf(sys.getfilesystemencoding() == 'ascii',
+                     'need a filesystem encoding different than ASCII')
+    def test_non_ascii(self):
         # Test handling of non-ascii data
-        if sys.getfilesystemencoding() != 'ascii':
-            if test.support.verbose:
-                import locale
-                print('locale encoding = %s, filesystem encoding = %s'
-                      % (locale.getpreferredencoding(), sys.getfilesystemencoding()))
-            command = "assert(ord('\xe9') == 0xe9)"
-            assert_python_ok('-c', command)
+        if test.support.verbose:
+            import locale
+            print('locale encoding = %s, filesystem encoding = %s'
+                  % (locale.getpreferredencoding(), sys.getfilesystemencoding()))
+        command = "assert(ord('\xe9') == 0xe9)"
+        assert_python_ok('-c', command)
 
     # On Windows, pass bytes to subprocess doesn't test how Python decodes the
     # command line, but how subprocess does decode bytes to unicode. Python


More information about the Python-checkins mailing list