]> granicus.if.org Git - python/commitdiff
#12890: fix test on windows
authorR David Murray <rdmurray@bitdance.com>
Wed, 31 Oct 2012 00:20:09 +0000 (20:20 -0400)
committerR David Murray <rdmurray@bitdance.com>
Wed, 31 Oct 2012 00:20:09 +0000 (20:20 -0400)
Patch by Stephen Tonkin.

Lib/test/test_cgitb.py
Misc/ACKS

index b91fe504191230aec383e135e292faed77bd6cce..2e072a9f2ac53d5f909a2716e1f726599f1141a7 100644 (file)
@@ -36,13 +36,12 @@ class TestCgitb(unittest.TestCase):
             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)
@@ -50,14 +49,13 @@ class TestCgitb(unittest.TestCase):
         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)
index 1db819477a0e3ec8fe1c19acf39cf89f5ef8cc3d..d80ead042e18ad781d82c9726c4328afb27360b4 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1174,6 +1174,7 @@ Bennett Todd
 R Lindsay Todd
 Eugene Toder
 Erik Tollerud
+Stephen Tonkin
 Matias Torchinsky
 Sandro Tosi
 Richard Townsend