[py-svn] py-trunk commit 5e0646b82f03: refine win32 checks to also work on top of jython/win32

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Apr 20 19:46:32 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 1271785541 25200
# Node ID 5e0646b82f031ebdfc6e947129e8e978d1a988fe
# Parent  381509aaa6ad365614974fdd1f10494a53c953a8
refine win32 checks to also work on top of jython/win32

--- a/py/_path/local.py
+++ b/py/_path/local.py
@@ -5,7 +5,7 @@ import sys, os, stat, re, atexit
 import py
 from py._path import common
 
-iswin32 = sys.platform == "win32"
+iswin32 = sys.platform == "win32" or (os._name == 'nt')
 
 class Stat(object):
     def __getattr__(self, name):

--- a/testing/path/test_local.py
+++ b/testing/path/test_local.py
@@ -193,7 +193,7 @@ class TestLocalPath(common.CommonFSTests
         assert l[2] == p3 
 
 class TestExecutionOnWindows:
-    pytestmark = py.test.mark.skipif("sys.platform != 'win32'")
+    pytestmark = py.test.mark.skipif("not (sys.platform == 'win32' or os._name == 'nt')")
 
     def test_sysfind(self):
         x = py.path.local.sysfind('cmd')
@@ -201,7 +201,7 @@ class TestExecutionOnWindows:
         assert py.path.local.sysfind('jaksdkasldqwe') is None
 
 class TestExecution:
-    pytestmark = py.test.mark.skipif("sys.platform == 'win32'")
+    pytestmark = py.test.mark.skipif("sys.platform == 'win32' or os._name == 'nt'")
 
     def test_sysfind(self):
         x = py.path.local.sysfind('test')
@@ -357,7 +357,7 @@ def test_samefile(tmpdir):
     assert p.samefile(p) 
 
 class TestWINLocalPath:
-    pytestmark = py.test.mark.skipif("sys.platform != 'win32'")
+    pytestmark = py.test.mark.skipif("sys.platform != 'win32' and os._name != 'win32'")
 
     def test_owner_group_not_implemented(self, path1):
         py.test.raises(NotImplementedError, "path1.stat().owner")
@@ -406,7 +406,7 @@ class TestWINLocalPath:
             old.chdir()    
 
 class TestPOSIXLocalPath:
-    pytestmark = py.test.mark.skipif("sys.platform == 'win32'")
+    pytestmark = py.test.mark.skipif("sys.platform == 'win32' or os._name == 'nt'")
 
     def test_hardlink(self, tmpdir):
         linkpath = tmpdir.join('test')

--- a/py/_io/terminalwriter.py
+++ b/py/_io/terminalwriter.py
@@ -133,7 +133,8 @@ def ansi_print(text, esc, file=None, new
 
 def should_do_markup(file):
     return hasattr(file, 'isatty') and file.isatty() \
-           and os.environ.get('TERM') != 'dumb'
+           and os.environ.get('TERM') != 'dumb' \
+           and not (os._name == 'nt' and sys.platform.startswith('java'))
 
 class TerminalWriter(object):
     _esctable = dict(black=30, red=31, green=32, yellow=33, 

--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@ Changes between 1.2.1 and XXX
 - added links to the new capturelog and coverage plugins 
 - (issue87) fix unboundlocal error in assertionold code 
 - (issue86) improve documentation for looponfailing
+- fix jython/win32 issues
 
 
 Changes between 1.2.1 and 1.2.0



More information about the pytest-commit mailing list