Ejemplo
Test a click command without spawning a subprocess
sha256:02f8c2f7fe825dcfb2135cbd593f008e36f7550ce68c3fcfa7c6de1bcfcbb02f
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Test a click command without spawning a subprocess HOW
- Paquetes
- click 8.4.2
- Entorno
- python 3.12
- Creado
- 2026-08-13T18:43:59Z
Contrato
- define a command with an option and an argument
- assert CliRunner invokes it in-process and captures stdout
- assert a bad value exits with code 2 and an error message
- assert the exit code is available without a subprocess
Archivos
- csx.json
- requirements.txt
- src/__init__.py
- src/cli.py
- test/contract.py
Seeder de origen
Recibos de verificación
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-13 · ed25519:a2ec939a4c60e243
- · CONTAINER_RUN · compile:SKIPPED · contract:FAIL · load:SKIPPED · resolve:PASS · python@1 · 2026-08-13 · ed25519:7da3f610facce8bf