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
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