* test: fix universal type checker based on downstream use and more testing * fix: type validation error reporting * fix: types; various * chore: switch off test-time type checking still too many errors |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| config.py | ||
| discovery.py | ||
| environment.py | ||
| README.md | ||
| result.py | ||
| runner.py | ||
| utils.py | ||
Frappe Testing Module
This module provides a comprehensive framework for running tests in Frappe applications. It includes functionality for test discovery, execution, result reporting, and environment setup.
Key Components
TestConfig: Configuration class for customizing test executionTestRunner: Main class for running test suites with additional Frappe-specific functionalityTestResult: Custom test result class for improved output formatting and loggingdiscover_all_tests: Function to discover all tests in specified Frappe appsdiscover_doctype_tests: Function to discover tests for specific DocTypesdiscover_module_tests: Function to discover tests in specific modules
Usage
This module is typically used by Frappe's CLI commands for running tests, but can also be used programmatically for custom test execution scenarios.
For detailed information about each component, please refer to the well-commented code in the following files:
__init__.py: Module initialization and logging setuprunner.py: TestRunner class and test execution logicdiscovery.py: Test discovery functionsresult.py: Custom TestResult class for result handlingenvironment.py: Test environment setup and teardown
Example
from frappe.testing import TestConfig, TestRunner, discover_all_tests
config = TestConfig(failfast=True, verbose=2)
runner = TestRunner(cfg=config)
discover_all_tests(['my_app'], runner)
runner.run()
For more detailed information about each component and its functionality, please refer to the docstrings and comments in the respective files.