Opened 3 weeks ago
Closed 3 weeks ago
#37303 closed New feature (wontfix)
Specify which test modules are being run in runtests.py
| Reported by: | AJ Collins | Owned by: | |
|---|---|---|---|
| Component: | Testing framework | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | AJ Collins | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
I'm new to the project and was reviewing tests on a PR (this one if that helps). I ran ./tests/runtests.py admin_scripts and thought it was running all the project's tests since it said "Found 238 test(s)". I naively thought 238 was too many tests for admin_scripts, and the output made no mention of "admin_scripts". I spent 5-10 minutes trying to see what I was doing wrong, since I was expecting the initial output to say *which* module was being run.
I'd like to propose that runtests.py specify the test module(s) being run *only when a subset is being run*. Proposed options below with changes surrounded in asterisks:
Option 1: List all modules being run. Potentially over-verbose when going beyond 10 modules...
> ./tests/runtests.py admin_scripts Testing against Django installed in '/home/ajc/django' with up to 10 processes Found 800 test(s). **Running tests in: admin_scripts, admin_views**.
Option 2: specify the number of modules being run:
> ./tests/runtests.py admin_scripts Testing against Django installed in '/home/ajc/django' with up to 10 processes Found 800 test(s) **across 2 module(s)**.
I'm mainly just hoping for some initial feedback from the test script indicating that I properly selected the subset of tests
Change History (2)
comment:1 by , 3 weeks ago
comment:2 by , 3 weeks ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
./tests/runtests.py admin_scripts --verbosity 2
With verbosity 2, it will display the test name and which directory they are being pulled from.
Actually might be more wise to keep this as a "read the docs" resolution (wontfix), since I was rushing. It's fairly high up on the Unit Tests doc :) https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-only-some-of-the-tests