diff --git a/pytest_timeout.py b/pytest_timeout.py index 682f597..6861f7b 100644 --- a/pytest_timeout.py +++ b/pytest_timeout.py @@ -8,13 +8,13 @@ """ import inspect import os +import shutil import signal import sys import threading import traceback from collections import namedtuple -import py import pytest @@ -444,7 +444,7 @@ def write_title(title, stream=None, sep="~"): """ if stream is None: stream = sys.stderr - width = py.io.get_terminal_width() + width, height = shutil.get_terminal_size() fill = int((width - len(title) - 2) / 2) line = " ".join([sep * fill, title, sep * fill]) if len(line) < width: