Ensure the pre-commit hook for styling tools is set up so CI won't fail on formatting issues. See setup instructions.
Tests can leave behind fake records that pollute your local database. Use a dedicated test site:
bench new-site --db-root-password admin --admin-password admin test_site
bench --site test_site install-app press
bench --site test_site add-to-hosts
bench --site test_site set-config allow_tests true
Start bench so background workers are available:
bench start
To reset all test data:
bench --site test_site reinstall --yes
Run all tests (usually only needed in CI):
bench --site test_site run-tests --app press
Run a single module:
bench --site test_site run-tests --app press \
--module press.press.doctype.some_doctype.test_some_doctype
Run a specific test:
bench --site test_site run-tests \
--module press.press.doctype.some_doctype.test_some_doctype \
--test test_very_specific_thing
- Neovim: frappe_test.vim
- VS Code: frappe-test-runner
::: tip For Neovim quickfix support, you can use a custom errorformat with makeprg hacks. :::