Re: How to break long method name into more than one line?

2012-03-14 Thread Herman
I followed the rule because it was a very good advice. For example, def test_plus_1Plus1_2(self): If this test fails, you immediately know that it's testing the plus method, with 1 and 1 as the arguments, and expect to return 2. Sticking this rule also means your test cases are small enough, so

Re: How to break long method name into more than one line?

2012-03-14 Thread Terry Reedy
On 3/14/2012 4:53 PM, Herman wrote: I followed the rule because it was a very good advice. For example, def test_plus_1Plus1_2(self): Suppose you want to test that a function call returns a particular 300-char multiline string? If this test fails, you immediately know that it's testing the

Re: How to break long method name into more than one line?

2012-03-13 Thread Jean-Michel Pichavant
Chris Angelico wrote: Just never treat them as laws of physics (in Soviet Physics, rules break you!). ChrisA hum ... I wonder how this political message is relevant to the OP problem. JM -- http://mail.python.org/mailman/listinfo/python-list

Re: How to break long method name into more than one line?

2012-03-13 Thread Chris Angelico
On Tue, Mar 13, 2012 at 9:30 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Chris Angelico wrote: Just never treat them as laws of physics (in Soviet Physics, rules break you!). hum ... I wonder how this political message is relevant to the OP problem. Ehh, it's a reference to the

Re: How to break long method name into more than one line?

2012-03-12 Thread Chris Angelico
On Tue, Mar 13, 2012 at 3:24 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On 12 Mar 2012 00:30:08 GMT, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info declaimed the following in gmane.comp.python.general: I expect that naming rule was invented by either people who have heard of

How to break long method name into more than one line?

2012-03-11 Thread Herman
I am trying to stick to the rule described in the TDD book that, each test method name consists of the method name to be tested, inputs and the expected outputs. It takes up a lot of space and my company has a rule of limiting 79 characters (or 80) per line. I found that def abcdeef\ dddaaa(self):

Re: How to break long method name into more than one line?

2012-03-11 Thread Roy Smith
In article mailman.571.1331492028.3037.python-l...@python.org, Herman sorsor...@gmail.com wrote: I am trying to stick to the rule described in the TDD book that, each test method name consists of the method name to be tested, inputs and the expected outputs. It takes up a lot of space and my

Re: How to break long method name into more than one line?

2012-03-11 Thread Steven D'Aprano
On Sun, 11 Mar 2012 11:53:45 -0700, Herman wrote: I am trying to stick to the rule described in the TDD book that, each test method name consists of the method name to be tested, inputs and the expected outputs. *The* TDD book? There's only one? Surely not. That rule sounds utterly

Re: How to break long method name into more than one line?

2012-03-11 Thread Roy Smith
In article 4f5d4390$0$29891$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: You can't split tokens over multiple lines, or put any whitespace between them. Well, if you truly wanted to be perverse, you could write some kind of decorator: