A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-April/110747.html below:

[Python-Dev] Adding test case methods to TestCase subclasses

[Python-Dev] Adding test case methods to TestCase subclasses [Python-Dev] Adding test case methods to TestCase subclassesBen Finney ben+python at benfinney.id.au
Fri Apr 15 23:25:28 CEST 2011
Ethan Furman <ethan at stoneleaf.us> writes:

> Ben Finney wrote:
> > TestCase subclasses is a multiple-inheritance use case that I share.
> > The mix-ins add test cases (methods named ‘test_’ on the mix-in
> > class) to the TestCase subclass. I would prefer not to use multiple
> > inheritance for this if it can be achieved in a better way.
> >
> > How can composition add test cases detectable by Python's ‘unittest’?
>
> Metaclasses, if's that an option...
[…]
> or a class decorator
[…]

Both interesting, thank you. But Python 3 isn't an option for several
projects where I'd like to use this.

-- 
 \     “What is needed is not the will to believe but the will to find |
  `\       out, which is the exact opposite.” —Bertrand Russell, _Free |
_o__)                           Thought and Official Propaganda_, 1928 |
Ben Finney

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4