Opened 14 years ago

Closed 14 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)

comment:1 by Simon Meers, 14 years ago

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?

in reply to:  1 comment:2 by Karen Tracey, 14 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 Simon Meers, 14 years ago

Resolution: invalid
Status: newclosed

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