frappe-testing-unit
Installation
SKILL.md
Unit & Integration Testing
Quick Reference
| Task | Command / Class |
|---|---|
| Run all tests | bench --site test_site run-tests |
| Run tests for app | bench --site test_site run-tests --app myapp |
| Run tests for doctype | bench --site test_site run-tests --doctype "Sales Order" |
| Run single test method | bench --site test_site run-tests --doctype "Sales Order" --test test_submit |
| Run tests for module | bench --site test_site run-tests --module "myapp.mymodule.doctype.mydt.test_mydt" |
| Run with profiler | bench --site test_site run-tests --doctype "Task" --profile |
| Run with failfast | bench --site test_site run-tests --failfast |
| Generate JUnit XML | bench --site test_site run-tests --junit-xml-output /path/report.xml |
| Skip fixture loading | bench --site test_site run-tests --skip-test-records --skip-before-tests |
| Base class (v14) | from frappe.tests.utils import FrappeTestCase |
| Unit test class (v15+) | from frappe.tests.classes import UnitTestCase |
| Integration test class (v15+) | from frappe.tests.classes import IntegrationTestCase |
Related skills