Skip to content

Commit 4f7ebae

Browse files
authored
Replace deprecated py.io.get_terminal_width() with shutil.get_terminal_size() (#116)
1 parent b8a2fa6 commit 4f7ebae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytest_timeout.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"""
99
import inspect
1010
import os
11+
import shutil
1112
import signal
1213
import sys
1314
import threading
1415
import traceback
1516
from collections import namedtuple
1617

17-
import py
1818
import pytest
1919

2020

@@ -444,7 +444,7 @@ def write_title(title, stream=None, sep="~"):
444444
"""
445445
if stream is None:
446446
stream = sys.stderr
447-
width = py.io.get_terminal_width()
447+
width, height = shutil.get_terminal_size()
448448
fill = int((width - len(title) - 2) / 2)
449449
line = " ".join([sep * fill, title, sep * fill])
450450
if len(line) < width:

0 commit comments

Comments
 (0)