[svn r37315] Skipping test on Windows (no fcntl), removing stuff from try/finally body\n(too much crap in there, obfuscates errors).
--HG-- branch : trunk
This commit is contained in:
parent
6795b4d23c
commit
1e7d516666
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import py
|
||||||
from py.__.misc.terminal_helper import get_terminal_width
|
from py.__.misc.terminal_helper import get_terminal_width
|
||||||
|
|
||||||
def test_terminal_width():
|
def test_terminal_width():
|
||||||
|
@ -7,11 +8,14 @@ def test_terminal_width():
|
||||||
"""
|
"""
|
||||||
assert get_terminal_width()
|
assert get_terminal_width()
|
||||||
try:
|
try:
|
||||||
|
import fcntl
|
||||||
|
except ImportError:
|
||||||
|
py.test.skip('fcntl not supported on this platform')
|
||||||
def f(*args):
|
def f(*args):
|
||||||
raise ValueError
|
raise ValueError
|
||||||
import fcntl
|
|
||||||
ioctl = fcntl.ioctl
|
ioctl = fcntl.ioctl
|
||||||
fcntl.ioctl = f
|
fcntl.ioctl = f
|
||||||
|
try:
|
||||||
cols = os.environ.get('COLUMNS', None)
|
cols = os.environ.get('COLUMNS', None)
|
||||||
os.environ['COLUMNS'] = '42'
|
os.environ['COLUMNS'] = '42'
|
||||||
assert get_terminal_width() == 41
|
assert get_terminal_width() == 41
|
||||||
|
|
Loading…
Reference in New Issue