assertStartWith vs assertStartwith

I am going to add several additional assertion methods for unittest.

This is an old issue, and such methods (assertIsSubclass, assertHasAttr, assertEndsWith) are already defined in several test files. The question is how to spell correctly some names. It seems that there are different opinions and my level of English does not allow me to make a qualified choice.

  • assertStartsWith and assertEndsWith
  • assertStartswith and assertEndswith
0 voters
3 Likes

I recommend assertStartsWith() and assertEndsWith(), both for readability and for accessibility – screen readers will have a better chance with the extra capitals and it helps people with dyslexia and cognitive disabilities.

It doesn’t really matter that str.startswith is all lower case, because we’re creating a new method name.

All the other methods follow the same capitalisation rule.

For example, the one that checks checks isinstance is assertIsInstance and not assertIsinstance.

Here’s similar accessibility advice about hashtags:

See also Change environment variable style - #2 by hugovk.

9 Likes