init
This commit is contained in:
commit
38355d2442
9083 changed files with 1225834 additions and 0 deletions
15
.venv/lib/python3.8/site-packages/mypy/test/testutil.py
Normal file
15
.venv/lib/python3.8/site-packages/mypy/test/testutil.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import os
|
||||
from unittest import mock, TestCase
|
||||
|
||||
from mypy.util import get_terminal_width
|
||||
|
||||
|
||||
class TestGetTerminalSize(TestCase):
|
||||
def test_get_terminal_size_in_pty_defaults_to_80(self) -> None:
|
||||
# when run using a pty, `os.get_terminal_size()` returns `0, 0`
|
||||
ret = os.terminal_size((0, 0))
|
||||
mock_environ = os.environ.copy()
|
||||
mock_environ.pop('COLUMNS', None)
|
||||
with mock.patch.object(os, 'get_terminal_size', return_value=ret):
|
||||
with mock.patch.dict(os.environ, values=mock_environ, clear=True):
|
||||
assert get_terminal_width() == 80
|
||||
Loading…
Add table
Add a link
Reference in a new issue