Commits

Anonymous committed 7648b7e

#12890: fix test on windows

Patch by Stephen Tonkin.

Comments (0)

Files changed (2)

Lib/test/test_cgitb.py

             self.assertIn("ValueError", text)
             self.assertIn("Hello World", text)
 
-    @unittest.skipIf(sys.platform=='win32', "test fails on windows, see issue 12890")
     def test_syshook_no_logdir_default_format(self):
         with temp_dir() as tracedir:
             rc, out, err = assert_python_failure(
                   '-c',
-                  ('import cgitb; cgitb.enable(logdir="%s"); '
-                   'raise ValueError("Hello World")') % tracedir)
+                  ('import cgitb; cgitb.enable(logdir=%s); '
+                   'raise ValueError("Hello World")') % repr(tracedir))
         out = out.decode(sys.getfilesystemencoding())
         self.assertIn("ValueError", out)
         self.assertIn("Hello World", out)
         self.assertIn('<p>', out)
         self.assertIn('</p>', out)
 
-    @unittest.skipIf(sys.platform=='win32', "test fails on windows, see issue 12890")
     def test_syshook_no_logdir_text_format(self):
         # Issue 12890: we were emitting the <p> tag in text mode.
         with temp_dir() as tracedir:
             rc, out, err = assert_python_failure(
                   '-c',
-                  ('import cgitb; cgitb.enable(format="text", logdir="%s"); '
-                   'raise ValueError("Hello World")') % tracedir)
+                  ('import cgitb; cgitb.enable(format="text", logdir=%s); '
+                   'raise ValueError("Hello World")') % repr(tracedir))
         out = out.decode(sys.getfilesystemencoding())
         self.assertIn("ValueError", out)
         self.assertIn("Hello World", out)
 R Lindsay Todd
 Eugene Toder
 Erik Tollerud
+Stephen Tonkin
 Matias Torchinsky
 Sandro Tosi
 Richard Townsend
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.