Skip to content

Commit 536252c

Browse files
committed
refine win32 checks to also work on top of jython/win32
--HG-- branch : trunk
1 parent 7cd899f commit 536252c

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changes between 1.2.1 and XXX
44
- added links to the new capturelog and coverage plugins
55
- (issue87) fix unboundlocal error in assertionold code
66
- (issue86) improve documentation for looponfailing
7+
- fix jython/win32 issues
78

89

910
Changes between 1.2.1 and 1.2.0

py/_io/terminalwriter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ def ansi_print(text, esc, file=None, newline=True, flush=False):
133133

134134
def should_do_markup(file):
135135
return hasattr(file, 'isatty') and file.isatty() \
136-
and os.environ.get('TERM') != 'dumb'
136+
and os.environ.get('TERM') != 'dumb' \
137+
and not (os._name == 'nt' and sys.platform.startswith('java'))
137138

138139
class TerminalWriter(object):
139140
_esctable = dict(black=30, red=31, green=32, yellow=33,

py/_path/local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import py
66
from py._path import common
77

8-
iswin32 = sys.platform == "win32"
8+
iswin32 = sys.platform == "win32" or (os._name == 'nt')
99

1010
class Stat(object):
1111
def __getattr__(self, name):

testing/path/test_local.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ def test_visit_depth_first(self, tmpdir):
193193
assert l[2] == p3
194194

195195
class TestExecutionOnWindows:
196-
pytestmark = py.test.mark.skipif("sys.platform != 'win32'")
196+
pytestmark = py.test.mark.skipif("not (sys.platform == 'win32' or os._name == 'nt')")
197197

198198
def test_sysfind(self):
199199
x = py.path.local.sysfind('cmd')
200200
assert x.check(file=1)
201201
assert py.path.local.sysfind('jaksdkasldqwe') is None
202202

203203
class TestExecution:
204-
pytestmark = py.test.mark.skipif("sys.platform == 'win32'")
204+
pytestmark = py.test.mark.skipif("sys.platform == 'win32' or os._name == 'nt'")
205205

206206
def test_sysfind(self):
207207
x = py.path.local.sysfind('test')
@@ -357,7 +357,7 @@ def test_samefile(tmpdir):
357357
assert p.samefile(p)
358358

359359
class TestWINLocalPath:
360-
pytestmark = py.test.mark.skipif("sys.platform != 'win32'")
360+
pytestmark = py.test.mark.skipif("sys.platform != 'win32' and os._name != 'win32'")
361361

362362
def test_owner_group_not_implemented(self, path1):
363363
py.test.raises(NotImplementedError, "path1.stat().owner")
@@ -406,7 +406,7 @@ def test_sysfind_in_currentdir(self, path1):
406406
old.chdir()
407407

408408
class TestPOSIXLocalPath:
409-
pytestmark = py.test.mark.skipif("sys.platform == 'win32'")
409+
pytestmark = py.test.mark.skipif("sys.platform == 'win32' or os._name == 'nt'")
410410

411411
def test_hardlink(self, tmpdir):
412412
linkpath = tmpdir.join('test')

0 commit comments

Comments
 (0)