The framework now uses pytest-style automatic test discovery - no pattern configuration needed!
Just like pytest, the framework automatically discovers test files matching these patterns:
-
test_*.py- Files starting withtest_test_example.pytest_data_validation.pytest_my_feature.py
-
*_test.py- Files ending with_testexample_test.pydata_validation_test.pymy_feature_test.py
- ✅ No configuration needed - Just name your files correctly
- ✅ Recursive search - Finds tests in all subdirectories
- ✅ Both patterns - Matches both
test_*and*_test - ✅ Workspace support - Works for both local and workspace tests
my_project/
├── tests/
│ ├── test_auth.py ← Found!
│ ├── test_database.py ← Found!
│ ├── integration/
│ │ ├── test_api.py ← Found!
│ │ └── test_webhooks.py ← Found!
│ ├── unit/
│ │ ├── validation_test.py ← Found!
│ │ └── parser_test.py ← Found!
│ └── helper.py ← Skipped (doesn't match pattern)
# Discovers all test_* and *_test files automatically
dbx_test run --local
# Same automatic discovery for remote tests
dbx_test run --remote --profile dev
# Workspace tests also use automatic discovery
dbx_test run --remote --workspace-tests \
--tests-dir "/Workspace/Repos/my-repo/tests"Discovering tests matching: test_* or *_test
Found 6 test notebook(s):
• tests/test_auth.py
• tests/test_database.py
• tests/integration/test_api.py
• tests/integration/test_webhooks.py
• tests/unit/validation_test.py
• tests/unit/parser_test.py
Running tests...
# Had to specify pattern
dbx_test run --remote --pattern "test_*"
dbx_test run --remote --pattern "*integration*"# No pattern needed! Automatic discovery
dbx_test run --remote
# Just use descriptive names
# test_integration.py or integration_test.pytest_user_authentication.py # Clear what it tests
test_data_pipeline.py # Clear what it tests
api_integration_test.py # Clear what it tests
check_users.py # Won't be discovered
validate_data.py # Won't be discovered
tests_for_api.py # Won't be discovered (wrong pattern)
In Databricks workspace, notebooks don't show .py extension in the UI, but the discovery still works:
/Workspace/Users/me/tests/
├── test_feature_a ← Found!
├── test_feature_b ← Found!
├── validation_test ← Found!
└── helpers ← Skipped
dbx_test run --remote --workspace-tests \
--profile adb \
--tests-dir "/Workspace/Users/me/tests"The test_pattern setting in config/test_config.yml is now deprecated but kept for backwards compatibility:
paths:
workspace_root: "/Workspace/tests"
# test_pattern is no longer needed!
# Discovery is automatic: test_* and *_testA: No, the framework now uses pytest-style discovery only. This makes it more predictable and follows Python testing conventions.
A: Rename them to follow pytest conventions:
my_tests.py→test_my_feature.pyormy_feature_test.py
A: Yes! Automatic discovery works everywhere:
- Local tests (
--local) - Remote tests (
--remote) - Workspace tests (
--remote --workspace-tests)
A: Yes! You can mix:
tests/
├── test_feature.py ← Found!
├── feature_test.py ← Found!
└── another_test.py ← Found!
✨ Just name your test files with test_* or *_test and the framework finds them automatically!
No configuration, no patterns, no hassle - just like pytest! 🎉