Skip to content

Commit e9c64db

Browse files
committed
Updated release date in changelog for version 4.3.1 to today
Also: - Fixed a test issue that could leave spurious temporary code coverage files around
1 parent 611a3a9 commit e9c64db

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dist
1313

1414
# Code Coverage
1515
.coverage
16+
.coverage.*
1617
htmlcov
1718
junit
1819
coverage.xml

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 4.3.1 (TBD)
1+
## 4.3.1 (October 24, 2026)
22

33
- Bug Fixes
44
- Fixed `@with_annotated` command `--help` output bypassing the application's output stream,

‎tests/test_pipeline_job_control.py‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,11 +1314,20 @@ def test_command_reads_the_terminal_after_a_subprocess_wrote_to_a_slow_pipe(tmp_
13141314
producer = tmp_path / "producer.py"
13151315
producer.write_text("import sys\nsys.stdout.write('x' * 262144)\n", encoding="utf-8")
13161316
slow = tmp_path / "slow.py"
1317-
slow.write_text("import sys, time\nwhile sys.stdin.buffer.read(16384):\n time.sleep(0.15)\n", encoding="utf-8")
1317+
slow_pid = tmp_path / "slow.pid"
1318+
slow.write_text(
1319+
"import os, pathlib, sys, time\n"
1320+
f"pathlib.Path({str(slow_pid)!r}).write_text(str(os.getpid()))\n"
1321+
"while sys.stdin.buffer.read(16384):\n"
1322+
" time.sleep(0.15)\n",
1323+
encoding="utf-8",
1324+
)
13181325
application = tmp_path / "application.py"
1326+
application_pid = tmp_path / "application.pid"
13191327
application.write_text(
1320-
"import os, subprocess, sys\n"
1328+
"import os, pathlib, subprocess, sys\n"
13211329
"from cmd2 import Cmd\n"
1330+
f"pathlib.Path({str(application_pid)!r}).write_text(str(os.getpid()))\n"
13221331
"class App(Cmd):\n"
13231332
" def do_produce(self, _):\n"
13241333
f" subprocess.run([sys.executable, {str(producer)!r}], stdout=self.stdout, check=True)\n"
@@ -1376,6 +1385,12 @@ def wait_until(predicate):
13761385
)
13771386
assert "ANSWER=answer" in transcript[start:]
13781387
finally:
1388+
# Killing the session leader leaves cmd2 and the slow consumer running past the end of the test. Coverage would then
1389+
# write their data files after pytest-cov has combined them.
1390+
for pid_file in (application_pid, slow_pid):
1391+
if pid_file.exists():
1392+
with contextlib.suppress(ProcessLookupError):
1393+
os.kill(int(pid_file.read_text()), signal.SIGKILL)
13791394
os.close(master)
13801395
process.kill()
13811396
process.wait(timeout=5)

0 commit comments

Comments
 (0)