Skip to content

Commit 1b0bef9

Browse files
T4rk1nKoolADE85
andauthored
Update .ai/TESTING.md
Co-authored-by: Adrian Borrmann <adrian.borrmann@plot.ly>
1 parent 874afd4 commit 1b0bef9

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

.ai/TESTING.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,31 @@ Dash includes a pytest/Selenium testing framework for unit and integration tests
88
# Install testing dependencies
99
pip install -e .[testing]
1010

11-
# Run all tests
12-
pytest tests/
11+
## Running tests — CRITICAL RULES
1312

14-
# Run unit tests
15-
pytest tests/unit/
13+
You must activate the virtual environment before running any tests.
1614

17-
# Run integration tests
18-
pytest tests/integration/
15+
### Unit tests
1916

20-
# Run specific test
21-
pytest tests/integration/callbacks/test_basic.py::test_name
17+
```
18+
source .venv/bin/activate && python -m pytest "tests/unit/" 2>&1
19+
```
20+
21+
### Integration tests
22+
23+
Always work with a specific test or test file. NEVER run all integration tests at once.
2224
23-
# Headless mode (CI)
24-
pytest --headless tests/integration/
2525
```
26+
source .venv/bin/activate && python -m pytest tests/integration/callbacks/test_basic_callback.py --headless -xvs 2>&1
27+
```
28+
29+
**NEVER truncate test output so aggressively that you cannot see failures.**
30+
`tail -5` or `tail -10` is NEVER acceptable — you will miss the error details and waste time re-running.
31+
Always use `tail -50` at minimum, or omit the tail entirely for short test runs.
32+
33+
**NEVER use `grep "FAILED"` to filter test output** — it hides the actual error messages.
34+
35+
When a test fails, you MUST be able to see the assertion error, traceback, and context in a SINGLE run. If your command truncates this, your command is wrong.
2636
2737
## Fixtures
2838

0 commit comments

Comments
 (0)