refine win32 checks to also work on top of jython/win32

--HG--
branch : trunk
This commit is contained in:
holger krekel 2010-04-20 10:45:41 -07:00
parent 7cd899fd3c
commit 536252cb2e
4 changed files with 8 additions and 6 deletions

View File

@ -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

View File

@ -133,7 +133,8 @@ def ansi_print(text, esc, file=None, newline=True, flush=False):
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,

View File

@ -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):

View File

@ -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')