Opened 5 years ago

Closed 5 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: UI/UX:

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)

comment:1 follow-up: Changed 5 years ago by DrMeers

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I imagine this is partly because of unittest's camel-case convention for setUp and tearDown -- it would look inconsistent with those otherwise. Though having said that I write my own test_method_names_like_this_too. Probably doesn't really matter. Other opinions?

comment:2 in reply to: ↑ 1 Changed 5 years ago by kmtracey

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 Changed 5 years ago by DrMeers

  • Resolution set to invalid
  • Status changed from new to 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.

Note: See TracTickets for help on using tickets.
Back to Top