refine win32 checks to also work on top of jython/win32
--HG-- branch : trunk
This commit is contained in:
parent
7cd899fd3c
commit
536252cb2e
|
@ -4,6 +4,7 @@ Changes between 1.2.1 and XXX
|
||||||
- added links to the new capturelog and coverage plugins
|
- added links to the new capturelog and coverage plugins
|
||||||
- (issue87) fix unboundlocal error in assertionold code
|
- (issue87) fix unboundlocal error in assertionold code
|
||||||
- (issue86) improve documentation for looponfailing
|
- (issue86) improve documentation for looponfailing
|
||||||
|
- fix jython/win32 issues
|
||||||
|
|
||||||
|
|
||||||
Changes between 1.2.1 and 1.2.0
|
Changes between 1.2.1 and 1.2.0
|
||||||
|
|
|
@ -133,7 +133,8 @@ def ansi_print(text, esc, file=None, newline=True, flush=False):
|
||||||
|
|
||||||
def should_do_markup(file):
|
def should_do_markup(file):
|
||||||
return hasattr(file, 'isatty') and file.isatty() \
|
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):
|
class TerminalWriter(object):
|
||||||
_esctable = dict(black=30, red=31, green=32, yellow=33,
|
_esctable = dict(black=30, red=31, green=32, yellow=33,
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sys, os, stat, re, atexit
|
||||||
import py
|
import py
|
||||||
from py._path import common
|
from py._path import common
|
||||||
|
|
||||||
iswin32 = sys.platform == "win32"
|
iswin32 = sys.platform == "win32" or (os._name == 'nt')
|
||||||
|
|
||||||
class Stat(object):
|
class Stat(object):
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
|
|
|
@ -193,7 +193,7 @@ class TestLocalPath(common.CommonFSTests):
|
||||||
assert l[2] == p3
|
assert l[2] == p3
|
||||||
|
|
||||||
class TestExecutionOnWindows:
|
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):
|
def test_sysfind(self):
|
||||||
x = py.path.local.sysfind('cmd')
|
x = py.path.local.sysfind('cmd')
|
||||||
|
@ -201,7 +201,7 @@ class TestExecutionOnWindows:
|
||||||
assert py.path.local.sysfind('jaksdkasldqwe') is None
|
assert py.path.local.sysfind('jaksdkasldqwe') is None
|
||||||
|
|
||||||
class TestExecution:
|
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):
|
def test_sysfind(self):
|
||||||
x = py.path.local.sysfind('test')
|
x = py.path.local.sysfind('test')
|
||||||
|
@ -357,7 +357,7 @@ def test_samefile(tmpdir):
|
||||||
assert p.samefile(p)
|
assert p.samefile(p)
|
||||||
|
|
||||||
class TestWINLocalPath:
|
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):
|
def test_owner_group_not_implemented(self, path1):
|
||||||
py.test.raises(NotImplementedError, "path1.stat().owner")
|
py.test.raises(NotImplementedError, "path1.stat().owner")
|
||||||
|
@ -406,7 +406,7 @@ class TestWINLocalPath:
|
||||||
old.chdir()
|
old.chdir()
|
||||||
|
|
||||||
class TestPOSIXLocalPath:
|
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):
|
def test_hardlink(self, tmpdir):
|
||||||
linkpath = tmpdir.join('test')
|
linkpath = tmpdir.join('test')
|
||||||
|
|
Loading…
Reference in New Issue