Commits

Armin Rigo committed 1273570

Duplicate the tests to also run in a plain ascii mode. Useful because I
can't find a machine which doesn't just skip all these tests with
"encoding not good enough".

  • Participants
  • Parent commits 7532271

Comments (0)

Files changed (1)

File rpython/rlib/test/test_rposix.py

     def as_unicode(self):
         return self.unistr
 
-class TestPosixUnicode:
+class BasePosixUnicode:
     def setup_method(self, method):
-        self.ufilename = (unicode(udir.join('test_open')) +
-                          u'\u65e5\u672c.txt') # "Japan"
+        self.ufilename = self._get_filename()
         try:
             f = file(self.ufilename, 'w')
         except UnicodeEncodeError:
             rposix.unsetenv(self.path)
 
         interpret(f, []) # does not crash
+
+
+class TestPosixAscii(BasePosixUnicode):
+    def _get_filename(self):
+        return str(udir.join('test_open_ascii'))
+
+class TestPosixUnicode(BasePosixUnicode):
+    def _get_filename(self):
+        return (unicode(udir.join('test_open')) +
+                u'\u65e5\u672c.txt') # "Japan"