#32602: Clarify wording re: parallel testing and test case vs. test case class
------------------------------------------------+------------------------
Reporter: Chris Jerdonek | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: 3.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Currently, there are some places in the docs, code, and code comments that
aren't quite clear or right in the way they talk about parallel testing as
it relates to test cases versus test case classes.
For example, here in the docs:
https://docs.djangoproject.com/en/3.1/topics/testing/advanced/#django.test.runner.DiscoverRunner
it says:
> If there are fewer test cases than configured processes, Django will
reduce the number of processes accordingly.
But it should say, "If there are fewer test case ''classes'' than
configured processes."
Similarly, this code comment:
https://github.com/django/django/blob/41850eec99366a51f98123f7c51e5bc5a8b2798c/django/test/runner.py#L653-L654
should say:
{{{#!python
# Since tests are distributed across processes on a per-TestCase
# *class* basis, there's no need for more processes than TestCase
# *classes*.
}}}
And also, `partition_suite_by_case()`:
https://github.com/django/django/blob/41850eec99366a51f98123f7c51e5bc5a8b2798c/django/test/runner.py#L845
should really be called something like `partition_suite_by_class()` or
`partition_suite_by_test_class()` since it groups by `type`, and the
docstring updated accordingly.
I think this is subtle but important because, without being clear, it's
easy for people to mistakenly think that the parallel test runner is
parallelizing individual test cases, when it's really distributing out the
test cases grouped by class.
--
Ticket URL: <https://code.djangoproject.com/ticket/32602>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.246a0c09a2e624ab2ded8c8d9e8c464c%40djangoproject.com.