tests: run in parallel with pytest-xdist

pytest now runs with -n auto; pass -n0 to run tests one by one. The
pty harness starts pqcli through subprocess instead of pty.fork(),
which is unsafe in the threaded xdist workers, and the child claims
the pty as its controlling terminal so ^C still raises SIGINT.
This commit is contained in:
Dash committed 2026-10-17 19:53:53 +02:00
1 parent d1d7c2d9df
commit 9689372e25
3 files changed
+66 -17

No files matched your search

+11 -1
View File
@@ -37,7 +37,13 @@ requires = ["hatchling"]
build-backend = "hatchling.build"
[dependency-groups]
dev = ["prek>=0.2", "pyte>=0.8", "pytest>=8.0", "ty>=0.0.89"]
dev = [
"prek>=0.2",
"pyte>=0.8",
"pytest>=8.0",
"pytest-xdist>=3.0",
"ty>=0.0.89",
]
[tool.ty.src]
# Only the package and its tests; agent worktrees under .claude/ would
@@ -53,6 +59,10 @@ select = ["E", "F", "W", "I", "UP"]
[tool.ruff.lint.isort]
known-first-party = ["pqcli"]
[tool.pytest.ini_options]
# Run tests in parallel; pass -n0 to run them one by one.
addopts = "-n auto"
[tool.coverage.run]
# Also measure the pqcli processes the tests start, such as the curses
# UI driven through a pseudo-terminal.