[issue17037] Add conforms_to_pep399() to test.support

2013-01-26 Thread Eli Bendersky
Eli Bendersky added the comment: On Sat, Jan 26, 2013 at 9:10 AM, Eric Snow wrote: > > Eric Snow added the comment: > > In my case I've been doing PEP 399 for collections.OrderedDict. It struck > me that the boilerplate could be stowed away in a decorator. It's more > than just adding a coupl

[issue17037] Add conforms_to_pep399() to test.support

2013-01-26 Thread Eric Snow
Eric Snow added the comment: > Do you have a real use case for the 'names' argument? My use case was with the tests for OrderedDict. The existing tests don't refer to collections.OrderedDict, but rather to OrderedDict (looked up from the globals). The names argument facilitates the replaceme

[issue17037] Add conforms_to_pep399() to test.support

2013-01-26 Thread Eric Snow
Eric Snow added the comment: In my case I've been doing PEP 399 for collections.OrderedDict. It struck me that the boilerplate could be stowed away in a decorator. It's more than just adding a couple subclasses. Here's what it covers: * add the test case subclasses, * make sure the original

[issue17037] Add conforms_to_pep399() to test.support

2013-01-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure how the "lots of repetition" is a problem. The following: class CCoverage(Coverage): decimal = C class PyCoverage(Coverage): decimal = P is quite trivial compared to the actual base test case (the Coverage class). Not only it is quite triv

[issue17037] Add conforms_to_pep399() to test.support

2013-01-26 Thread Eli Bendersky
Eli Bendersky added the comment: Antoine - I think I can see the use case. ATM, to conform to PEP399, every test _class_ has to be subclassed twice with appropriate assignment to the relevant tested class. This leads to a lot of repetition. As an example, see test_decimal.py, which does this a

[issue17037] Add conforms_to_pep399() to test.support

2013-01-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure what the use case for this is. It looks more obfuscating than revealing to me. -- nosy: +pitrou ___ Python tracker ___ ___

[issue17037] Add conforms_to_pep399() to test.support

2013-01-26 Thread Eli Bendersky
Eli Bendersky added the comment: Nice work, although I worry this is starting to get into "too much magic" territory. Do you have a real use case for the 'names' argument? -- nosy: +eli.bendersky ___ Python tracker

[issue17037] Add conforms_to_pep399() to test.support

2013-01-26 Thread Eric Snow
Eric Snow added the comment: The decorator also mitigates the problem described in issue #16835. -- ___ Python tracker ___ ___ Python-

[issue17037] Add conforms_to_pep399() to test.support

2013-01-25 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue17037] Add conforms_to_pep399() to test.support

2013-01-25 Thread Eric Snow
Eric Snow added the comment: One step I left out is handling the whole pickle/copyreg case outlined by #16817. -- ___ Python tracker ___

[issue17037] Add conforms_to_pep399() to test.support

2013-01-25 Thread Eric Snow
Eric Snow added the comment: One lingering doubt I have is about how I throw the two new test case classes into the globals. They're already getting bound, as a pair, to the original test class's name... -- ___ Python tracker

[issue17037] Add conforms_to_pep399() to test.support

2013-01-25 Thread Eric Snow
New submission from Eric Snow: Related to issue #16817 and to my efforts on a C OrderedDict, I think it would be nice to have a class decorator that handles most of the PEP 399 requirements for you. The attached patch adds such a decorator to test.support. -- assignee: eric.snow compo