Opened 15 years ago
Closed 15 years ago
#14521 closed (invalid)
Camel case used for mthods' names
| Reported by: | gurunars | Owned by: | nobody |
|---|---|---|---|
| Component: | Uncategorized | Version: | 1.2 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Check the following paragraph http://docs.djangoproject.com/en/1.2/topics/testing/#django.test.TestCase.fixtures
For example, the code does not look consistent when you use def testFluffyAnimals instead of def test_fluffy_animals.
Change History (3)
follow-up: 2 comment:1 by , 15 years ago
comment:2 by , 15 years ago
Replying to DrMeers:
Yes, I expect setUp and tearDown are likely responsible for the sometimes-used camel case in tests. So long as we are consistent within a class I think it is fine, camel case test method names are perfectly valid and sometimes used as the convention.
comment:3 by , 15 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
For the sake of consistency, one could argue that test_send_email further down that page should actually be converted to camel case, but it really doesn't matter. As Karen mentioned, consistency within classes is the main issue.
I imagine this is partly because of
unittest's camel-case convention forsetUpandtearDown-- it would look inconsistent with those otherwise. Though having said that I write my owntest_method_names_like_this_too. Probably doesn't really matter. Other opinions?