EazyTests
A robust and easy-to-use test runner for Python unittest test classes with automatic logging and reporting.
Overview
EazyTests provides a simple yet powerful Engine class that allows you to run one or more unittest test classes, capture results, and automatically log them to a file. Perfect for test automation, CI/CD pipelines, and test suite management.
Features
- ✅ Run one or multiple test classes in a single call
- ✅ Automatic test result logging with timestamps
- ✅ Comprehensive test reporting (passed, failed, errors, skipped)
- ✅ Detailed failure and error tracebacks in log files
- ✅ Optional automatic log file opening
- ✅ Method chaining for fluent API
- ✅ Programmatic access to test results
Installation
pip install eazytests
Quick Start
Basic Usage
from unittest import TestCase
from eazytester import Engine
class TestReaders(TestCase):
def test_read_txt_file(self):
# Your test code here
self.assertTrue(True)
def test_read_xlsx_file(self):
# Your test code here
self.assertIsNotNone({})
# Run tests
engine = Engine()
success = engine.add_tests(TestReaders).run_tests()
print(f"All tests passed: {success}")
Multiple Test Classes
from eazytester import Engine
engine = Engine(output_file="results/test_report.log")
success = engine.add_tests(TestReaders, TestWriters, TestParsers).run_tests()
Without Auto-opening Log File
engine = Engine(output_file="test_results.log", open_log=False)
engine.add_tests(TestReaders).run_tests()
Accessing Results Programmatically
engine = Engine()
engine.add_tests(TestReaders).run_tests()
results = engine.get_results()
print(f"Total tests: {results['total_tests']}")
print(f"Failures: {results['failures']}")
print(f"Errors: {results['errors']}")
print(f"Success: {results['success']}")
API Reference
Engine Class
Constructor
Engine(output_file: Optional[str] = None, open_log: bool = True)
Parameters:
output_file(str, optional): Path to the log file. Defaults to'test_results.log'open_log(bool, optional): Whether to automatically open the log file after writing. Defaults toTrue
Methods
add_tests(*test_classes: Type[TestCase]) -> Engine
Add one or more test classes to run.
Parameters:
*test_classes: One or moreunittest.TestCasesubclasses
Returns: Engine instance (allows method chaining)
Raises: ValueError if a class is not a subclass of unittest.TestCase
Example:
engine.add_tests(TestClass1, TestClass2, TestClass3)
run_tests() -> bool
Execute all added test classes and log results.
Returns: True if all tests passed, False otherwise
Raises: RuntimeError if no test classes have been added
Example:
success = engine.run_tests()
get_results() -> dict
Get test results summary.
Returns: Dictionary containing:
total_tests(int): Total number of tests runfailures(int): Number of test failureserrors(int): Number of test errorsskipped(int): Number of skipped testssuccess(bool): Whether all tests passedoutput(str): Detailed test outputfailures_detail(list): List of (test, traceback) tuples for failureserrors_detail(list): List of (test, traceback) tuples for errors
Example:
results = engine.get_results()
Log File Format
The generated log file includes:
Test Results - 2026-05-15 10:30:45
============================================================
SUMMARY
------------------------------------------------------------
Total Tests: 5
Passed: 4
Failures: 0
Errors: 1
Skipped: 0
Status: ✗ FAILED
DETAILED OUTPUT
------------------------------------------------------------
[Detailed test runner output...]
ERRORS
------------------------------------------------------------
[Error tracebacks if any...]
Examples
Example 1: Running Tests from a Single Class
from unittest import TestCase
from eazytester import Engine
class TestMathOperations(TestCase):
def test_addition(self):
self.assertEqual(2 + 2, 4)
def test_subtraction(self):
self.assertEqual(5 - 2, 3)
engine = Engine(output_file="math_tests.log")
success = engine.add_tests(TestMathOperations).run_tests()
Example 2: Running Multiple Test Suites
from eazytester import Engine
engine = Engine(output_file="full_test_suite.log")
engine.add_tests(
TestDataParsers,
TestFileReaders,
TestDataValidators
).run_tests()
Example 3: Suppressing Auto-Open and Manual Result Checking
engine = Engine(output_file="results.log", open_log=False)
engine.add_tests(MyTestClass).run_tests()
results = engine.get_results()
if not results['success']:
print(f"Tests failed! {results['failures']} failures, {results['errors']} errors")
Requirements
- Python 3.7+
- unittest (built-in standard library)
License
MIT
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Support
For issues, questions, or suggestions, please open an issue on the project repository.
Metadata
Release files for eazytester 26.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eazytester-26.5.3.tar.gz | 4.5 kB | Without provenance | Details for eazytester-26.5.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eazytester-26.5.3-py3-none-any.whl | Python 3 | none | any | Details for eazytester-26.5.3-py3-none-any.whl |
Total release size: 9.4 kB
Release files / eazytester-26.5.3.tar.gz
| Download URL | eazytester-26.5.3.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f621fcd4c6b41a624e451b933b5d1d6411aee7ac62647a351b3ed61c6d0f120c
|
|
BLAKE2b-256 checksum How to use checksums |
e704b869f8534275d13bf4ed3d19d065501f7734cedba7165dad75ada8253ae9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / eazytester-26.5.3-py3-none-any.whl
| Download URL | eazytester-26.5.3-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18c3024a6df0f656f32a6c286727c0ff87ee90432300ace55ca835ef65483319
|
|
BLAKE2b-256 checksum How to use checksums |
e646eb381afd0385cd3df3120fa0ffc3f4beea0fcc7840ba42e8e85c9b7a7307
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for eazytester 26.5.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.