Install & Compatibility
Where this runs
tested against v2.6.20251216093331 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 53.1MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 7.6s · import 0.000s · 54MB
53MB installed
● package 53MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
main
✓ from cwltest import main
✗ from cwltest.cwltest import main
This quickstart demonstrates how to use the `cwltest` command-line tool to run tests against a simple CWL workflow. It creates a dummy CWL workflow and a test definition file, then executes `cwltest`. For `cwltest` to actually run the CWL workflow during testing, a CWL runner like `cwltool` must be installed alongside `cwltest`.
import subprocess
import tempfile
from pathlib import Path
import os
# Create a dummy CWL workflow file
cwl_content = """
cwlVersion: v1.0
class: CommandLineTool
baseCommand: echo
inputs:
message:
type: string
inputBinding:
position: 1
outputs:
output:
type: stdout
stdout: output.txt
"""
# Create a dummy CWL test file
test_content = """
- doc: Example test for echo tool
tool: workflow.cwl
job:
message: Hello, CWL!
output:
output: Hello, CWL!\n
- doc: Another test
tool: workflow.cwl
job:
message: Another message
output:
output: Another message\n
"""
with tempfile.TemporaryDirectory() as tmpdir:
tmp_path = Path(tmpdir)
workflow_path = tmp_path / "workflow.cwl"
test_path = tmp_path / "test_example.yml"
workflow_path.write_text(cwl_content)
test_path.write_text(test_content)
print(f"Created dummy workflow: {workflow_path}")
print(f"Created dummy test file: {test_path}")
print("\nRunning cwltest...")
try:
# cwltest uses cwltool by default to execute the workflow
# Ensure cwltool is installed for this example to fully function:
# pip install cwltest cwltool
cmd = ["cwltest", "--test", str(test_path), "--basedir", str(tmp_path)]
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
print("cwltest output:")
print(result.stdout)
print("Tests passed successfully!")
except subprocess.CalledProcessError as e:
print(f"cwltest failed with error: {e}")
print(f"Stderr: {e.stderr}")
print(f"Stdout: {e.stdout}")
except FileNotFoundError:
print("Error: 'cwltest' command not found. Ensure cwltest is installed and in your PATH.")
print("Note: You might also need 'cwltool' installed for cwltest to execute CWL workflows.")
cwltest --version
Debug
Known issues
breakingSupport for Python 3.9 has been removed in recent versions. Users on Python 3.9 will encounter installation errors or runtime failures.fixUpgrade your Python environment to version 3.10, 3.11, 3.12, 3.13, or 3.14.
affects: >=2.6.20251216093331
gotchacwltest frequently updates its internal pytest dependency and can have compatibility issues with very old or very new pytest versions. Check release notes if encountering plugin loading issues.fixRefer to the cwltest GitHub releases and `pyproject.toml` for supported `pytest` versions. Upgrade or downgrade `pytest` if you encounter `InvalidPluginWarning` or test runner issues.
affects: All versions, especially when pytest is upgraded/downgraded independently.
gotchacwltest uses a date-based versioning scheme (e.g., `2.6.YYYYMMDDHHMMSS`) rather than standard semantic versioning (Major.Minor.Patch). This indicates frequent releases, but the 'Minor' component (`2.6` here) does not strictly adhere to typical breaking change expectations.fixBe aware that new releases might introduce changes (including deprecations or minor breaking changes) more frequently than a strict semantic versioning scheme might imply for a 'patch' or 'minor' release.
affects: All versions
gotchaWhile `cwltest` provides the testing framework, it requires a separate CWL runner (like `cwltool`) to execute the actual CWL workflows defined in your tests. `cwltest` defaults to using `cwltool`.fixEnsure that `cwltool` (or your preferred CWL runner) is installed in the same environment as `cwltest` for tests to run successfully (e.g., `pip install cwltest cwltool`).
affects: All versions
Upgrade
Version history
2.6.20251216093331latest on PyPI · released Jan 7, 2026
Audit
Dependencies
pythonrequiredRequires Python >=3.10 and <3.15.
pytestoptionalOften used as a pytest plugin for running CWL tests. Version compatibility is frequently updated.
cwltooloptionalThe default CWL reference runner used by cwltest to execute workflows during testing. While not a direct pip dependency of cwltest, it is required for cwltest to run actual CWL tests.