[py-svn] py-trunk commit eb7ffb9f3553: for now don't test close(0) on windows - it hangs there

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue May 18 20:43:46 CEST 2010


# HG changeset patch -- Bitbucket.org
# Project py-trunk
# URL http://bitbucket.org/hpk42/py-trunk/overview
# User holger krekel <holger at merlinux.eu>
# Date 1274208202 25200
# Node ID eb7ffb9f3553af6b41d3d27c9dafafba56885fe1
# Parent  f740e5319ec4ceabc76077885f94706894ad62cc
for now don't test close(0) on windows - it hangs there

--- a/testing/io_/test_capture.py
+++ b/testing/io_/test_capture.py
@@ -372,6 +372,15 @@ class TestStdCaptureFDinvalidFD:
                 os.close(2)
                 cap = py.io.StdCaptureFD(out=False, err=True, in_=False)
                 cap.done()
+        """)
+        result = testdir.runpytest("--capture=fd")
+        assert result.ret == 0
+        assert result.parseoutcomes()['passed'] == 2
+
+    @py.test.mark.xfail("sys.platform == 'win32'", run=False)
+    def test_stdcapture_fd_invalid_fd_null(self, testdir):
+        testdir.makepyfile("""
+            import py, os
             def test_stdin():
                 os.close(0)
                 cap = py.io.StdCaptureFD(out=False, err=False, in_=True)
@@ -379,7 +388,8 @@ class TestStdCaptureFDinvalidFD:
         """)
         result = testdir.runpytest("--capture=fd")
         assert result.ret == 0
-        assert result.parseoutcomes()['passed'] == 3
+        assert result.parseoutcomes()['passed'] == 1
+                   
 
 def test_capture_not_started_but_reset(): 
     capsys = py.io.StdCapture(now=False)



More information about the pytest-commit mailing list