Test runners
Introduction
CSTesting for Python (C:\CSTesting-Python) ships a built-in runner—the python -m cstesting CLI and the run() function in cstesting.runner. Tests are written with describe / it (Jest-style), not with pytest’s @pytest.mark or unittest classes. You can wrap python -m cstesting in CI (GitHub Actions, Azure Pipelines, etc.) like any other shell command.
Supported: built-in runner
The supported workflow is:
- Define suites with
describe("Name", suite_fn)and tests withit("name", fn)insidesuite_fn. - Run
python -m cstesting(optionally with a path, glob, or tag filters). Seecstesting/cli.py. - For Playwright, you call
create_browseryourself; the runner does not inject a browser.
From code (after importing a module that registers suites):
from cstesting import describe, it, expect, run
def _suite():
it("works", lambda: expect(1).to_be(1))
describe("Smoke", _suite)
result = run()
print(result.passed, result.failed, result.total)
See Lifecycle & hooks and Running and debugging tests.
pytest / unittest
CSTesting Python is not a pytest plugin. You can keep pytest for other projects; for CSTesting, use describe/it and python -m cstesting. Mixing the same test file in both runners is not the intended model.
Config-driven runs
Alternative to code: run flows from a .conf file with python -m cstesting run my.conf or python -m cstesting my.conf --headed. That path uses run_config_file (README.md).
CI and virtualenv
Typical pipeline steps: install Python, pip install -e ".[browser]", playwright install chromium, then python -m cstesting from the repo root. Publish report/report.html as a build artifact if you want the HTML report.
Requirements file
Pin the package in requirements.txt or use editable install from your CSTesting-Python clone:
pip install -e "C:/CSTesting-Python[browser]"
Parallel execution
The built-in runner executes tests sequentially within each loaded file. For parallelism, run separate processes (e.g. split globs or directories across jobs); there is no in-process parallel test worker pool.
Summary
| Runner / tool | Supported? | Notes |
|---|---|---|
python -m cstesting | Yes | Primary entry point; discovers *.test.py / *.spec.py or a given path. |
run() | Yes | After suites are registered by importing test modules. |
| pytest | No | Not integrated; use CSTesting’s runner. |
Config .conf | Yes | python -m cstesting run file.conf |
| Parallel (in-process) | No | Sequential execution; use multiple processes if needed. |