From 1e7d516666d22c14d2c72881e87e27dbabe0ded7 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 25 Jan 2007 10:51:51 +0100 Subject: [PATCH] [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 --- py/misc/testing/test_terminal.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/py/misc/testing/test_terminal.py b/py/misc/testing/test_terminal.py index daba8351d..8b0d44c20 100644 --- a/py/misc/testing/test_terminal.py +++ b/py/misc/testing/test_terminal.py @@ -1,5 +1,6 @@ import os +import py from py.__.misc.terminal_helper import get_terminal_width def test_terminal_width(): @@ -7,11 +8,14 @@ def test_terminal_width(): """ assert get_terminal_width() try: - def f(*args): - raise ValueError import fcntl - ioctl = fcntl.ioctl - fcntl.ioctl = f + except ImportError: + py.test.skip('fcntl not supported on this platform') + def f(*args): + raise ValueError + ioctl = fcntl.ioctl + fcntl.ioctl = f + try: cols = os.environ.get('COLUMNS', None) os.environ['COLUMNS'] = '42' assert get_terminal_width() == 41