Skip to content

aymanebouljam/swift-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftTest

SwiftTest is a small, production-ready CLI wrapper around pytest that improves terminal UX with a clean summary and cached slow-test reporting.

Requirements

  • Python 3.11+
  • A local virtual environment at .venv

Tech Stack

  • Python 3.11+
  • pytest
  • pytest-json-report
  • rich
  • setuptools
  • ruff
  • mypy

Setup

python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -e ".[dev]"

Installation

For editable local development:

python -m pip install -e ".[dev]"

When working on this project, prefer the local virtual environment:

.venv/bin/python -m pip install -e ".[dev]"

Usage

Run tests and cache the latest report:

swifttest run

Pass extra arguments through to pytest:

swifttest run -- -q tests/test_parser.py

Generate a mixed demo report with passed, failed, skipped, and errored tests:

swifttest run -- demo_tests

Show the last saved summary without rerunning tests:

swifttest summary

Show the slowest tests from the last saved report:

swifttest slow

Show more slow tests:

swifttest slow --top 10

After running the demo suite above, swifttest summary will show all summary columns with data, and swifttest slow will list the slowest demo tests by their recorded setup/call/teardown durations.

Development

Run the quality checks from the local virtual environment:

.venv/bin/python -m pytest
.venv/bin/python -m ruff check .
.venv/bin/python -m mypy src tests

Report Cache

SwiftTest stores the latest pytest JSON report at:

.swifttest/latest-report.json

About

SwiftTest is a CLI wrapper around pytest that delivers cleaner terminal summaries, caches JSON test reports, and highlights the slowest tests for faster feedback.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages