Green: A Clean, Colorful, and Fast Python Test Runner
This repository profile is provided by osrepos.com, an open source repository discovery platform.
Summary
Green is an innovative Python test runner designed for clarity, speed, and visual appeal. It provides a clean, colorful, and fast way to execute `unittest` based tests, enhancing the developer experience with detailed, aligned output and parallel execution.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
Green is a modern, feature-rich Python test runner that brings a fresh perspective to unittest execution. Developed by CleanCut, Green emphasizes clean, colorful, and fast test results, making the test-driven development cycle more intuitive and enjoyable. It supports parallel test execution, offers multiple verbosity levels, and integrates with popular tools like coverage and Django.
Installation
To get started with Green, simply install it using pip:
pip3 install green
To upgrade an existing installation:
pip3 install --upgrade green
Examples
Once installed, running your tests with Green is straightforward. Here are a few common ways to use it:
Run from inside your code directory:
green
Run from outside your code directory, specifying the target:
green code_directory
Run a specific test file:
green test_stuff.py
Run a specific test within a package:
green package.test.test_module.TestClass.test_function
For more options and detailed usage, you can always run green --help or refer to the complete command-line options.
Why Use Green
Green stands out with a compelling set of features designed to improve your testing workflow:
- Clean and Colorful Output: Say goodbye to gray, cluttered terminal output. Green provides vertically aligned, low-redundancy results with vibrant colors, making it easy to spot successes and failures.
- Fast Execution: Tests run in independent processes, utilizing multiple processors by default for significantly faster execution times.
- Powerful and Traditional: It leverages the standard
unittestclasses and methods while offering multi-target auto-discovery. - Descriptive Verbosity: Choose from various verbosity levels, from simple dots to full docstring output, to get the right amount of detail.
- Convenient Integrations: Includes Bash and ZSH completion for options and test targets, built-in
coverageintegration, and support forsetup.pycommands and Django. - Modern and Portable: Supports Python 3.8+ and PyPy, and is compatible with macOS, Linux, BSDs, and Windows.
Green's origin story highlights a journey to create a test runner that prioritizes developer experience, addressing shortcomings found in other tools regarding output clarity, Python 3 compatibility, and maintainability. It was born from a desire for a truly "Red/Green/Refactor" experience, emphasizing the visual feedback crucial for TDD.
Links
Explore Green further through these resources:
- GitHub Repository: CleanCut/green
- Discussions: Open a discussion
- Issue Tracker: Submit an issue
- Pull Requests: Submit a pull request
- Training Course: Python Testing with Green on Udemy
Source repository
Open the original repository on GitHub.