From 33f27f44dc1cf656d1343fd63c6f6542c98fb8d8 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Fri, 12 Jun 2026 09:17:09 +0200 Subject: [PATCH 1/4] Terminal dimensions and buffer --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 608492ef6..317120ec8 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name='moler', - version='4.10.1', + version='4.10.50', description='Moler is a library for working with terminals, mainly for automated tests', # Required long_description=long_description, long_description_content_type='text/markdown', From a2a9d2e11a042e283492de70dd5bfba21462e25d Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Fri, 12 Jun 2026 09:18:56 +0200 Subject: [PATCH 2/4] terminal --- moler/io/raw/terminal_no_fork.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moler/io/raw/terminal_no_fork.py b/moler/io/raw/terminal_no_fork.py index 5f3a7eff1..36334a467 100644 --- a/moler/io/raw/terminal_no_fork.py +++ b/moler/io/raw/terminal_no_fork.py @@ -36,11 +36,11 @@ def __init__( moler_connection: Connection, cmd: str = "/bin/bash", select_timeout: float = 0.002, - read_buffer_size: int = 4096, + read_buffer_size: int = 4096000, first_prompt: str = r"[%$#\]]+", target_prompt: str = r"moler_bash#", set_prompt_cmd: str = 'unset PROMPT_COMMAND; export PS1="moler_bash# "\n', - dimensions: Tuple[int, int] = (100, 300), + dimensions: Tuple[int, int] = (1000, 3000), terminal_delayafterclose: float = 0.2, ): """ From 674dc6e51b0c6ae2b05bc898821b1176a9fd07fe Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Fri, 19 Jun 2026 11:12:04 +0200 Subject: [PATCH 3/4] dar --- moler/asyncio_runner.py | 17 ++++++++--------- test/conftest.py | 8 +++++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/moler/asyncio_runner.py b/moler/asyncio_runner.py index 87710a4cb..49cce705d 100644 --- a/moler/asyncio_runner.py +++ b/moler/asyncio_runner.py @@ -35,23 +35,22 @@ current_process = psutil.Process() -if platform.system() == 'Linux': - - # Check if RLIMIT_NOFILE is available in your psutil - # noinspection PyUnresolvedReferences - (max_open_files_limit_soft, max_open_files_limit_hard) = current_process.rlimit(psutil.RLIMIT_NOFILE) -else: +if platform.system() == 'Windows': # https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmaxstdio?view=vs-2019 (max_open_files_limit_soft, max_open_files_limit_hard) = (510, 512) # TODO: any way on Win? +else: + # Unix (Linux, Darwin, BSD, ...): read the real RLIMIT_NOFILE via stdlib resource module. + import resource + (max_open_files_limit_soft, max_open_files_limit_hard) = resource.getrlimit(resource.RLIMIT_NOFILE) def system_resources_usage(): - if platform.system() == 'Linux': - curr_fds_open = current_process.num_fds() - else: + if platform.system() == 'Windows': ofiles = current_process.open_files() osockets = current_process.connections(kind="all") curr_fds_open = len(ofiles) + len(osockets) # TODO: any better way on Win? + else: + curr_fds_open = current_process.num_fds() curr_threads_nb = threading.active_count() return curr_fds_open, curr_threads_nb diff --git a/test/conftest.py b/test/conftest.py index 8a23550c0..c1128c4c5 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -21,11 +21,13 @@ current_process = psutil.Process() -if platform.system() == 'Linux': - (max_open_files_limit_soft, max_open_files_limit_hard) = current_process.rlimit(psutil.RLIMIT_NOFILE) -else: +if platform.system() == 'Windows': # https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmaxstdio?view=vs-2019 (max_open_files_limit_soft, max_open_files_limit_hard) = (510, 512) # TODO: any way on Win? +else: + # Unix (Linux, Darwin, BSD, ...): read the real RLIMIT_NOFILE via stdlib resource module. + import resource + (max_open_files_limit_soft, max_open_files_limit_hard) = resource.getrlimit(resource.RLIMIT_NOFILE) def system_resources_usage(): From 4355a84c928ffc38c341e7ede0ccbe4ecd83ec5e Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Fri, 19 Jun 2026 11:18:27 +0200 Subject: [PATCH 4/4] --mccabe --- py3pytest.ini | 2 -- requirements/test.txt | 1 - setup.cfg | 4 ---- 3 files changed, 7 deletions(-) diff --git a/py3pytest.ini b/py3pytest.ini index 35e87da29..f58aaf0a9 100644 --- a/py3pytest.ini +++ b/py3pytest.ini @@ -1,4 +1,2 @@ [pytest] python_files = test_*.py py3test_*.py # testfiles running only under python3 start with py3test_ -mccabe-complexity = - *.py 10 diff --git a/requirements/test.txt b/requirements/test.txt index 285c14b67..c196b22ce 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -2,7 +2,6 @@ pycodestyle coveralls pytest -pytest-mccabe pytest-random mock pytest-cov diff --git a/setup.cfg b/setup.cfg index f84d83a91..81d63ed3e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,3 @@ -[tool:pytest] -mccabe-complexity = - *.py 10 - [pycodestyle] count = True ignore = E501